Composite Structure Diagram: Luca Colombi

You might also like

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 30

Composite Structure Diagram

Luca Colombi
Abstract
UML 2.0 composite structure diagram
Basic concepts
Structure, structured entity, internal structure
Elements
Property
Connector
Nested notation
Description power
Classes & Structured Classes
Instance specification
Namespace behaviour
Collaboration
Purpose
Roles
Role binder
Collaboration Occurrence
Occurrence binder
<<occurrence>> & <<represent>>
Port
Visibility
Interfaces
Examples
UML 2.0 diagram
Classified in UML 2.0 structural diagrams
New:
this diagram was not available in UML 1.*
Purpose
Composite structure diagrams can be used to
describe:
structures of interconnected parts
run-time structures of interconnected instances
Example:
Description of the parts of an engine that are
interconnected to perform the engine functioning
Structure
A set of instances that communicate and
collaborate at run-time to realize a common goal
Ex.: net routers that realize a particular journey

Structured element:
An element realized by a structure
Ex.: a net realized by routers

Internal structure:
A structure that realize a structured element
Ex.: all the routers in a net
Property
A set of instances contained in a structured
instance
MailSender

role of the property instances for the container (optional)


type or class of the property instances (obligatory)
ms:MailSender
roleName:TypeName

ms:MailSender

sendMail(…)
Connector
Represents
the visibility between two property
a communication way

proprerty w:Well
role multeplicity (optional)
connector type (optional) 2

a:Axis
[Multeplicity1] [multeplicity2] 1
roleName1 roleName2
connName:ConnType e:Engine

connector name (optional) role name (optional)


Nested notation
Composite structure diagrams allows to use
class diagram-like or nested notation
It is permitted to recursively nest already
nested entities Container
Container
contained1:Inner1[n1]

contained2:Inner2[n2]
contained1:Inner1 contained3:Inner3
property
contained2:Inner2
inner dash if
contained3:Inner3 not a composition multeplicity
(integer, optional)
Structured Class: example
Recursive application of nested notation can
be done inside a single diagram

RoomContents

geranium:Plant
john:Man
height:real
Leaf[*] Trunk
Description power
Nested notation can describe all things describable in
1.* class diagrams notation, and a little more

Car
Car

w 2 2 1 e:Engine
1 e w:Wheel[4]
a:Axis
Wheel Engine

* *
Axis
Instance specification
describes the property which is returned by
an operation call, the operation is pointed by
the arrow at the end of a dashed line that
starts from the returned type description

<<create>> is an optional label and specify that label


exists only after the operation call

Room
<<create>> c:Chair
createChair(…)
getWindow(…) Leg[4]
w:Window
Namespace behaviour

A structured class acts as a namespace for


its internal descriptions, so descriptions are
not implicitly exported
Collaboration
A joining of structure elements that
collaborate to collectively perform a task

The name given to the collaboration (obligatory)


Used in nested notation

CollaborationName
CollaborationName
Collaboration purpose
A collaboration wants to describe a structure
behaviour made by structure property
Must be connected only with property which
are required to perform its described
behaviour
Collaboration role
property which collaborate to perform the
collaboration goal, interpreting roles
Each collaboration role perform a specific
task
“Counting of clients” have some ClientCard as roles

Counting of clients
ClientCard

name:String
address:String

Collaboration Role Binder
represent a participation of the role to the
collaboration

property
Pilot
the name given to the role
collaboration

Drive a car
roleName

Car
Collaboration Occurrence
A specific collaboration instance

occName:CollName
used in nested notation

name of the instance (obligatory)


type of the instance (obligatory)
occName:CollName

send:MailSend
Occurrence binder
Binds an occurrence to a role, maybe specifing
how many occurrence repetitions are present

occName:CollName RoleType
roleName[n]

role name (optional)


role multeplicity (optional)

roleName:RoleType

[n]
selled[12]
Egg
occName:CollName sellProduct:Sell
john:Countryman
Example: occurrence - Send
mail

[1] [1]
mailServer[2]

Sender Receiver

send:Send an email
<<occurrence>> label
A dashed arrow between two symbol of same
type means that pointing symbol represent
pointed symbol, like in a specialization
<<occurrence>> label is optional

<<occurrence>>
Building Home

<<occurrence>>
Communicate Send email
<<represent>> label
A dashed arrow from a collaboration or an
occurrence to a property means that property
use the other instance, like a client or a use
case primary actor

<<represent>> label is optional

client:CurrentAccount
<<represent>>
deposit:Increase amount
accredit(…)
Occurrence binding nest
crossing
Occurrence binding is admitted between
separately nested elements with also have
occurrence bindings

products transport putting on shelf

p:producer d:dealer
Port
represent a property communication point,
and is always placed where the property joins
whit its connector
two types of communications:
Between a property and its external environment
Between a property and its internal structure
Ports: visibility marking
If port symbol cover a rectangle boundary his
visibility is public
If port symbol is placed inside a rectangle, adjacent
to his boundary, his visibility is protected
port instance name (optional)

port type (optional) Computer

portName:EntityName[n] m:Monitor[1]
property

port multeplicity (optional)

User
portName:EntityName[n]
Ports: interfaces
An interface exported by a port is a little circle
(interface symbol) connected with the port
symbol by a line
An interface needed by a port is a little
semicircle (socket symbol) connected with
the port symbol by a line
If interface is present, interface type is signed
near interface symbol
Ports: interfaces examples
Apache

httpService:HttpSrvc [100]
sqlServer:SqlSrv [1]

Apache
httpService:HttpSrvc [100]

SqlSrv
sqlServer[1]

HttpSrvc Apache
httpService [100]

SqlSrv
sqlServer
Example: Port

Structure with many kinds of connectors and ports:

StudentRoom

Keyboard

p:RoomDoor :Key[101]

Student
Computer

w:Window
Monitor
Example: structured class -
House
House

:Window :Window

Kitchen Bath

:Window :Door

Passage

:Window[2]

Hall Bedroom[2] :Window[1]


[1] [1]
Example:
collaboration - Drive a taxi
Drive a taxy

Car
GE_553912:Taxy
Well[4] Engine
[2]
:SteeringWheel [1]
place:Seat
[0..5]
Body
john:TaxyDriver
Head

kate:Passenger [2] [2]


Leg[2] Bust Arm[2]
References
OMG official site for UML:
http://www.uml.org
Agile software association
Composite structure diagrams:
http://www.agilemodeling.com/artifacts/compositeStructureDiagram.htm

You might also like