41
1 Modeling Server-side Components with UML Junichi Suzuki, Ph.D. [email protected] http://www.jks.la/jxs/ School of Information and Computer Science University of California, Irvine

1 Modeling Server-side Components with UML Junichi Suzuki, Ph.D. [email protected] School of Information and Computer Science University

Embed Size (px)

Citation preview

Page 1: 1 Modeling Server-side Components with UML Junichi Suzuki, Ph.D. jxs@computer.org  School of Information and Computer Science University

1

Modeling Server-side Components

with UML

Junichi Suzuki, [email protected]

http://www.jks.la/jxs/

School of Information and Computer Science

University of California, Irvine

Page 2: 1 Modeling Server-side Components with UML Junichi Suzuki, Ph.D. jxs@computer.org  School of Information and Computer Science University

2

Who am I?

• Research fellow, UC Irvine (2000-)– biologically-inspired software designs for

scalable and adaptable distributed computing

• Ph.D. from Keio U (2001)• ex- Technical director, Object

Management Group Japan • ex.ex- Technical director, Soken Planning

Co., Ltd.

Page 3: 1 Modeling Server-side Components with UML Junichi Suzuki, Ph.D. jxs@computer.org  School of Information and Computer Science University

3

Where is UC Irvine?

• UCI (U of California, Irvine)– One of eight UC system universities

• Irvine– in between LA and San Diego– reported by FBI, as the safest city in the US– 1 hour to LA downtown– 10 minutes to Newport Beach– 20 minutes to Huntington Beach– 20 minutes to Anaheim Disneyland– 5 hours to Las Vegas

Page 4: 1 Modeling Server-side Components with UML Junichi Suzuki, Ph.D. jxs@computer.org  School of Information and Computer Science University

4

Overview

• UML Profiles• UML Profile for EJB• UML Profiles and MDA

Page 5: 1 Modeling Server-side Components with UML Junichi Suzuki, Ph.D. jxs@computer.org  School of Information and Computer Science University

5

Model Transformation• 2 dimensions of model transformation

– Domain specialization– Platform specialization

• Several forms of model transformation– Manual transformation– Automatic transformation

Dom

ain

sp

eci

fici

ty

Platform specificity

Page 6: 1 Modeling Server-side Components with UML Junichi Suzuki, Ph.D. jxs@computer.org  School of Information and Computer Science University

6

Sale

Sales Line Item

Item

Customer

An Example of ManualDomain Specialization

Page 7: 1 Modeling Server-side Components with UML Junichi Suzuki, Ph.D. jxs@computer.org  School of Information and Computer Science University

7

Sale

Sales Line Item

Item

1

Sale

Sales Line Item

Item

1

1..*

1..*

1

0..1

1

0..*

Customer

Customer

Page 8: 1 Modeling Server-side Components with UML Junichi Suzuki, Ph.D. jxs@computer.org  School of Information and Computer Science University

8

Technologies forModel Transformations

• UML profiles– for EJB– for CORBA– for Realtime scheduling

• Action semantics– allows modelers to embed actions (behaviors)

into model elements.

Page 9: 1 Modeling Server-side Components with UML Junichi Suzuki, Ph.D. jxs@computer.org  School of Information and Computer Science University

9

UML Profiles

• A UML profile– provides a means to specialize UML models

to a specific domain or implementation technology.

– is defined with the UML extension mechanisms • i.e. stereotypes, tag definition/tagged values, and

constraints

– may extend the UML standard meta model.• virtual meta model

Page 10: 1 Modeling Server-side Components with UML Junichi Suzuki, Ph.D. jxs@computer.org  School of Information and Computer Science University

10

UML Profile for EJB

• used for specializing platform independent models to EJB specific models

Platform specificity

Dom

ain

sp

eci

fici

ty

Page 11: 1 Modeling Server-side Components with UML Junichi Suzuki, Ph.D. jxs@computer.org  School of Information and Computer Science University

11

• What UML Profile for EJB defines include:– Design model

• Java design model• EJB design model

– External model– Internal model

– Implementation model• Java implementation model• EJB implementation model

Page 12: 1 Modeling Server-side Components with UML Junichi Suzuki, Ph.D. jxs@computer.org  School of Information and Computer Science University

12

Java Design Model

• Defines UML representations of Java language constructs– Java class, interface, etc.

• Java package– mapped to a UML package– e.g. package edu.uci.ics;

edu::uci::ics

Page 13: 1 Modeling Server-side Components with UML Junichi Suzuki, Ph.D. jxs@computer.org  School of Information and Computer Science University

13

• Java Class– mapped to a UML class– e.g. public abstract class Test {}

• Java Interface– mapped to a UML interface or UML class

stereotyped as <<JavaInterface>>.– e.g. public interface Test {}

Test{abstract}

<<JavaInterface>>Test

Page 14: 1 Modeling Server-side Components with UML Junichi Suzuki, Ph.D. jxs@computer.org  School of Information and Computer Science University

14

• Java method– mapped to a UML operation– e.g. public void test() throw Foo{}

• + test(): void {JavaThrows=Foo}

• Others– Single type import– On demand type import

Page 15: 1 Modeling Server-side Components with UML Junichi Suzuki, Ph.D. jxs@computer.org  School of Information and Computer Science University

15

EJB Design Model

• Defines UML representations of EJB specific constructs– e.g. EJB remote interface, home interface,

etc.– External view

• Defines logical constructs visible to the clients of an EJB Enterprise Bean

– Internal view• Defines logical constructs visible to the developers

of an EJB Enterprise Bean

Page 16: 1 Modeling Server-side Components with UML Junichi Suzuki, Ph.D. jxs@computer.org  School of Information and Computer Science University

16

EJB Design Model: External View

• EJB remote interface– Mapped to a UML class stereotyped as

<<EJBRemoteInterface>>.• EJB home interface

– Mapped to a UML class stereotyped as <<EJBHomeInterface>>.

• EJB session home – Mapped to a UML class stereotyped as

<<EJBSessionHomeInterface>>.• EJB entity home

– Mapped to a UML class stereotyped as <<EJBEntityHomeInterface>>.

Page 17: 1 Modeling Server-side Components with UML Junichi Suzuki, Ph.D. jxs@computer.org  School of Information and Computer Science University

17

<<extends>>

<<EJBHomeInterface>>CustomerHome

+create():Customer

EJBHome

CustomerHome

create(): Customer

Page 18: 1 Modeling Server-side Components with UML Junichi Suzuki, Ph.D. jxs@computer.org  School of Information and Computer Science University

18

EJBHomeRemote

EJBObject

CustomerServerHome

+create():Customer

《 Interface 》Customer

+getCustomerEntry(name :String):String+setCustomerEntry(name :String):void

CustomerServer

+getCustomer (name :String):Customer

import java.rmi.Remote;import java.rmi.RemoteException;

《 Interface 》CustomerServerBean

+ejbPassivate():Void+ejbActivate():void+ejbCreate():void+ejbRemove():void+setSessionContext(context:SesseionContext):void+getCustomer (name :String):void

import.javax.ejb.*;import java.rmi.Remote;import java.rmi.RemoteException;

Javax.ejb.SessionBean

Javax.ejb.EnterpriseBean

《 implements 》《 import 》

《 import 》

《 extends 》

《 extends 》

《 extends 》

《 extends 》

Page 19: 1 Modeling Server-side Components with UML Junichi Suzuki, Ph.D. jxs@computer.org  School of Information and Computer Science University

19

• EJB Method– Means methods declared in EJB Remote and

Home interfaces– Mapped to a UML operation– <<EJBCreateMethod>>

• Represents a create method in a home interface

– <<EJBFinderMethod>>• Represents a finder interface in a home interface

– <<EJBRemoteMethod>>• Represents a method in a remote interface.

Page 20: 1 Modeling Server-side Components with UML Junichi Suzuki, Ph.D. jxs@computer.org  School of Information and Computer Science University

20

<<EJBRemoteInterface>>UserSession

<<EJBRemoteMethod>> deposit()<<EJBRemoteMethod>> withdraw()<<EJBRemoteMethod>> transfer()

<<EJBSessionHomeInterface>>UserSessionHome

<<EJBCreateMethod>> create()<<instantiate>>

Page 21: 1 Modeling Server-side Components with UML Junichi Suzuki, Ph.D. jxs@computer.org  School of Information and Computer Science University

21

• EJB primary key – Mapped to a UML usage association

stereotyped as <<EJBPrimaryKey>>.• between EJB primary key class and EJB entity

home

Page 22: 1 Modeling Server-side Components with UML Junichi Suzuki, Ph.D. jxs@computer.org  School of Information and Computer Science University

22

<<EJBRemoteInterface>>Customer

<<EJBRemoteMethod>> buy()<<EJBRemoteMethod>> getName()<<EJBRemoteMethod>> reserve()

<<EJBEntityHomeInterface>>CustomerHome

<<EJBCreateMethod>> create()<<EJBFinderMethod>> findByPrimaryKey()<<EJBFinderMethod>> findByCustomerId()<<instantiate>>

CustomerKey

getHashCode()

<<EJBPrimaryKey>>

Page 23: 1 Modeling Server-side Components with UML Junichi Suzuki, Ph.D. jxs@computer.org  School of Information and Computer Science University

23

EJB Design Model: Internal View

• EJB enterprise bean– Mapped to a UML subsystem stereotyped as

<<EJBEnterpriseBean>>.

• EJB session bean– Mapped to a UML subsystem stereotyped as

<<EJBSessionBean>>.

• EJB entity bean– Mapped to a UML subsystem stereotyped as

<<EJBEntityBean>>– <<EJBCmpField>> represents a container-

managed field (attribute).

Page 24: 1 Modeling Server-side Components with UML Junichi Suzuki, Ph.D. jxs@computer.org  School of Information and Computer Science University

24

<<EJBEntityBean>>

Customer

Specification elements Realization elements

Page 25: 1 Modeling Server-side Components with UML Junichi Suzuki, Ph.D. jxs@computer.org  School of Information and Computer Science University

25

• EJB enterprise bean is declared by– an EJB home interface,– an EJB remote interface,– an EJB implementation class– Supplemental Java classes and interfaces,

and– EJB deployment descriptor.

Page 26: 1 Modeling Server-side Components with UML Junichi Suzuki, Ph.D. jxs@computer.org  School of Information and Computer Science University

26

• EJB implementation class– Mapped to a UML class stereotyped as

<<EJBImplementation>>.• EJB remote interface

– Mapped to a UML abstraction association stereotyped as <<EJBRealizeRemote>>.• between EJB remote interface and EJB

implementation class.

• EJB home interface– Mapped to a UML abstraction association

stereotyped as <<EJBRealizeHome>>.• between EJB home interface and EJB

implementation class.

Page 27: 1 Modeling Server-side Components with UML Junichi Suzuki, Ph.D. jxs@computer.org  School of Information and Computer Science University

27

<<EJBEntityBean>>

Customer

Specification elements Realization elements

<<EJBRemoteInterface>>Customer

CustomerKey

<<EJBEntityHomeInterface>>CustomerHome

<<EJBPrimaryKey>>

<<instantiate>>

<<EJBImplementation>>CustomerBean

<<EJBRealizeHome>>

<<EJBRealizeRemote>>

Page 28: 1 Modeling Server-side Components with UML Junichi Suzuki, Ph.D. jxs@computer.org  School of Information and Computer Science University

28

Java Implementation Model

• Java class file– Mapped to a UML component stereotyped as

<<JavaClassFile>>.

• Java archive (JAR) file– Mapped to a UML package stereotyped as

<<JavaArchiveFile>>.

Page 29: 1 Modeling Server-side Components with UML Junichi Suzuki, Ph.D. jxs@computer.org  School of Information and Computer Science University

29

<<JavaArchiveFile>>

Foo

Bar

<<JavaClassFile>>

Customer

Page 30: 1 Modeling Server-side Components with UML Junichi Suzuki, Ph.D. jxs@computer.org  School of Information and Computer Science University

30

EJB Implementation Model

• EJB-JAR– Mapped to a UML package stereotyped as

<<EJB-JAR>>

• EJB deployment descriptor– Mapped to a UML component stereotyped as

<<EJBDescriptor>>

Page 31: 1 Modeling Server-side Components with UML Junichi Suzuki, Ph.D. jxs@computer.org  School of Information and Computer Science University

31

<<EJB-JAR>>

RetailShop

META-INF

<<EJBDescriptor>>ejb-jar.xml

<<JavaClassFile>>CustomerBean

<<JavaClassFile>>Customer

<<JavaClassFile>>CustomerHome

<<JavaClassFile>>CustomerKey

Page 32: 1 Modeling Server-side Components with UML Junichi Suzuki, Ph.D. jxs@computer.org  School of Information and Computer Science University

32

UML Profiles and MDA

• UML profiles– are key components to achieve MDA vision. – defines a set of mapping rules for model

transformations.

Page 33: 1 Modeling Server-side Components with UML Junichi Suzuki, Ph.D. jxs@computer.org  School of Information and Computer Science University

33

Traditional Modeling and Development

Traditionalmodeling/dev

tools

Domain analysts,Modelers, Designers,Developers

Domain expertise

Platform/technology expertise

Applications

Page 34: 1 Modeling Server-side Components with UML Junichi Suzuki, Ph.D. jxs@computer.org  School of Information and Computer Science University

34

MDA-based Modeling and Development

MDA tools

Platform experts

Domainexpertise

Application developers

Applications

Domain experts

Platformexpertise

Technology (logic impl)expertise

Page 35: 1 Modeling Server-side Components with UML Junichi Suzuki, Ph.D. jxs@computer.org  School of Information and Computer Science University

35

Goals in MDA

• Model continuation– Maximizing model continuation during

software development process.

• Separation of concerns– Maximizing separation of concerns

Page 36: 1 Modeling Server-side Components with UML Junichi Suzuki, Ph.D. jxs@computer.org  School of Information and Computer Science University

36

Benefits from MDA

• Reduced software development cost• Reduced software development time• Rapid and smooth integration of legacy

and emerging technologies

Page 37: 1 Modeling Server-side Components with UML Junichi Suzuki, Ph.D. jxs@computer.org  School of Information and Computer Science University

37

Model Transformationand Integration

• Model transformation– Domain specialization– Platform specialization

• Model integration– Model weaving

MDA tools

Platformexperts

Domainexpertise

Application developers

Applications

Domainexperts

Platformexpertise

Technology (logic impl)expertise

Page 38: 1 Modeling Server-side Components with UML Junichi Suzuki, Ph.D. jxs@computer.org  School of Information and Computer Science University

38

PIM

PSM

Sourcecode

Configurationfiles ・・・

Application

Domainmodels

Patterns

model transformations

generates/derives

MOFXMI

Model maintenanceand exchange

model transformations

Modeltransformations

MDA tools

Platformexperts

Domainexpertise

Application developers

Applications

Domainexperts

Platformexpertise

Technology (logic impl)expertise

Page 39: 1 Modeling Server-side Components with UML Junichi Suzuki, Ph.D. jxs@computer.org  School of Information and Computer Science University

39

Model Transformation

UMLJava/EJB interfaceCORBA IDL

ADL/ASLUMLCWM

PIM

PSM

Sourcecode

Configurationfiles ・・・

Application

Domainmodels

Patterns

model transformations

generates/derives

MOFXMI

Model maintenanceand exchange

model transformations

Modeltransformations

Action SemanticsUML Profile for EJBUML Profile for CORBAUML Profile for RT sched

Action SemanticsUML Profile for EJBUML Profile for CORBAUML Profile for RT sched

Page 40: 1 Modeling Server-side Components with UML Junichi Suzuki, Ph.D. jxs@computer.org  School of Information and Computer Science University

40

Model Transformation• 2 dimensions of model transformation

– Domain specialization– Platform specialization

• Several forms of model transformation– Manual transformation– Automatic transformation

Dom

ain

sp

eci

fici

ty

Platform specificity

Page 41: 1 Modeling Server-side Components with UML Junichi Suzuki, Ph.D. jxs@computer.org  School of Information and Computer Science University

41

Scope of UML Profile for EJBD

om

ain

sp

eci

fici

ty

Platform specificity

AbstractDomain Model

DetailedDomainModel

UML Profile for EJB

Detailed Modelspecific to

EJBSpecializes to

EJB