Académique Documents
Professionnel Documents
Culture Documents
Structural Things
Nouns of UML models Examples: Class Interface Collaboration Use case Components Artifacts Node
Syntax
interface
Syntax
Class
Description of a set of objects that share the same attributes, operations, relationships and semantics. Note that the operations open( ), close( ), etc. are behavioral things, so a class can also be a grouping thing
Window {abstract, author=Joe, status=tested} +size: Area = (100,100) #visibility: Boolean = true +default-size: Rectangle #maximum-size: Rectangle -xptr: XWindow* +display () +hide () +create () -attachXWindow(xwin:Xwindow*)
Window
Interface
Collection of operations that specify a service of a class or component Describes the externally visible behavior of a component Usually attached to a class or other component
Store -storeId: Integer -POSlist: List +create() +login(UserName, Passwd) +find(StoreId) +getPOStotals(POSid) +updateStoreTotals(Id,Sales) +get(Item)
StoreHome POSterminalHome POSterminal <<use>> POSterminal <<interface>> Store +getPOStotals(POSid) +updateStoreTotals(Id,Sales) +get(Item)
Store -storeId: Integer -POSlist: List +create() +login(UserName, Passwd) +find(StoreId) +getPOStotals(POSid) +updateStoreTotals(Id,Sales) +get(Item)
Collaboration
A society of roles and other elements that work together to provide a collective behavior Has structural and behavioral elements enclosed in it
Component
Modular part of system design that hides its implementation behind set of external interfaces A physical packaging of otherwise logical elements (i.e., accessible through the interfaces)
Node
Physical element that exists at runtime and represents a computational resource having some memory and processing ability
First class citizens Tie things together Group interesting collections of things
Relationships Diagrams
Behavioral Things
Dynamic part of UML models Verbs of model, representing behavior over time and space Generally connected to classes, collaborations & objects. 3 kinds: Interaction State Machine Actions
Interaction
Set of messages exchanged among objects within a context to accomplish a purpose. An interaction includes messages, action sequences(behavior invoked by a message) and links (relationships between objects) Points to object that receives the messages
display
Example
Message is called show Sent from button to window In real world, a button object sends a show message to a window object.
State machine
Sequence of states an object or interaction goes through, along with events to which it responds and its responses to those events Includes states, transitions (flow from state to state), events (things that trigger a transition), activities (response to a transition). State is shown as a rounded rectangle
caller off hook Idle Caller Active
Caller on hook
First class citizens Tie things together Group interesting collections of things
Relationships Diagrams
Grouping Things
Things into which you can decompose a model, or with which you can combine model elements. Packages Structural things, behavioral things, and/or grouping things can be placed in a package. Shown as a "tabbed" folder:
Annotational Things
Comments to describe, illuminate or remark about any element in a model. Note Used for informal or formal text Used for specifying some aspect outside the model
First class citizens Tie things together Group interesting collections of things
Relationships Diagrams
Description
Syntax
a relationship between two or more classifiers that involves connections among their instances. A special form of association that aggregation specifies a whole-part relationship between the aggregate (whole) and the component part. generalization a taxonomic relationship between a more general and a more specific element. a relationship between two modeling dependency elements, in which a change to one modeling element (the independent element) will affect the other modeling element (the dependent element).
20
Description
a relationship between a specification and its implementation.
Syntax
21
Relationships
Dependency Relationship between two things where a change in one thing (the "independent" thing) may affect the meaning of another thing (the "dependent" thing) Alternatively dependent thing uses independent thing Arrow goes from the "dependent" thing to the "independent" thing. Example: Window depends on Event Window uses Event
Association
Structural relationship that describes a set of links; i.e., relationships between objects. May have direction, may include a label, and often containing adornments such as multiplicity and role names: Example:
Generalization
Specialization/generalization relationship in which objects of the specialized element ("child") are substitutable for objects of the generalized element ("parent"). Child shares structure and behavior of parent Example: Employee is a kind of Person
Realization
One element specifies a "contract" that another element must carry out. Open-headed arrow points from the realizer to the element with the contract The element carrying out the contract is said to realize the other element. Example:
Aggregation
Construct aggregation Description A special form of association that specifies a whole-part relationship between the aggregate (whole) and the component part. Syntax
A composite aggregation (filled diamond) means that the multiplicity at the composite (part) end may be at most one. Shared aggregation (hollow diamond) means that the multiplicity at the composite end may be more than one.
26
Aggregation
Aggregation is the part-whole relationship. It relates classes, representing parts (or components) to the whole (or assembly) class.
27
UML Aggregation
In UML there are three types of aggregation:
28
Composition Aggregation
The whole owns the instances of the parts. Those instances cannot belong to any other instance of the whole.
29
Aircraft
1+
Engine
Wing
Fuselage
30
Composition
Window scrollbar [2]: Slider title: Header body: Panel
1 Header
body
1 Panel
31
Composition (contd)
Window
scrollbar:Slider
1 title:Header 1 body:Panel
32
Aggregation
Aggregation is most useful when there are common properties of components that can be attached to the assembly as a whole Or where operations can propagate from container to contained objects
33