UML Basic Structural Modeling 1
UML
Basic Structural Modeling
Part II
UML Basic Structural Modeling 2
Basic Structural Modeling
• Classes
Attributes, Operations, Responsibilities
• Relationships
Dependency, Generalization, Association, Role,
Multiplicity, Aggregation
• Common Mechanisms
Specifications, Adornments, Common Divisions,
Extensibility Mechanisms
• Diagrams
Class , Object , Component , Deployment Dagrams
UML Basic Structural Modeling 3
Common Mechanisms
Specifications
Adornments
Notes
Common Divisions
Extensibility Mechanisms
stereotypes
tagged values
constraints
UML Basic Structural Modeling 4
Adornments: Note
• Adornment that stands alone
• Note is a graphical symbol for rendering constraints
or comments attached to an element
• Used to specify things like requirements,
oservations, reviews, and explanations
• Can be simple text,an embedded URL, a link to a
document
Note
UML Basic Structural Modeling 5
Adornments: Note
• Examples
See URL
Shuttle.nasa.gov
Mission
full_name : string
Shuttle
start_engines()
stop_engines()
fuel_level() : integer
launch(t:time)
Launch time is
computed from
ephemeris
UML Basic Structural Modeling 6
Stereotypes
• Allows to extend the vocabulary of the UML
• Allows to create new building blocks, specific to
your problem
• Can be applied to any element (Class, Attribute,
Operation, …)
• Can be represented by
<< stereotype >>
new icon
both
UML Basic Structural Modeling 7
Stereotypes
a class can have a stereotype indicating what basic type
of class it is (e.g. controller, actor, interface)
represent a metaclassification of the class
appear within guillemets in normal type above the class
name
Window
size : Area = (100, 100)
visibility : Boolean = invisible
display ()
hide ()
«user interface»
UML Basic Structural Modeling 8
Operation Stereotypes
stereostypes can also be used to group together
operations with common characteristics
represent a metaclassification of the operation
BadSocket
throw()
log (String)
«helper»
setSocket(Socket)
«access»
getID():SocketID
setID(SocketID)
«exception»
UML Basic Structural Modeling 9
Stereotypes Examples
Shuttle
weight : Integer
age : Integer
status: enum = on-ground
<< NASA Object >>
Spacecraft
UML Basic Structural Modeling 10
Tagged Values
• Apply to any element of the UML
• Metadata that applies to the element not its instances
• Represent arbitrary information expressed in text form
• Commonly used to store Project Management
information
• Examples:
author of an element Author=John Smith
testing status Test = No
version number Version # = 4.2
UML Basic Structural Modeling 11
Constraints
restrict the values that object or links can assume
expressed as arbitrary expressions enclosed in braces
near the constrained elements
often use navigation expressions
constraints between two elements are depicted using a
dotted, labeled line
Astronaut
Member-of
Crew
Commander-of
{subset}
4..6 *
*1
UML Basic Structural Modeling 12
Constraint Examples
employer
CompanyemployeePerson
boss worker
{person.employer =
person.boss.employer}
*
*

Uml struct2

  • 1.
    UML Basic StructuralModeling 1 UML Basic Structural Modeling Part II
  • 2.
    UML Basic StructuralModeling 2 Basic Structural Modeling • Classes Attributes, Operations, Responsibilities • Relationships Dependency, Generalization, Association, Role, Multiplicity, Aggregation • Common Mechanisms Specifications, Adornments, Common Divisions, Extensibility Mechanisms • Diagrams Class , Object , Component , Deployment Dagrams
  • 3.
    UML Basic StructuralModeling 3 Common Mechanisms Specifications Adornments Notes Common Divisions Extensibility Mechanisms stereotypes tagged values constraints
  • 4.
    UML Basic StructuralModeling 4 Adornments: Note • Adornment that stands alone • Note is a graphical symbol for rendering constraints or comments attached to an element • Used to specify things like requirements, oservations, reviews, and explanations • Can be simple text,an embedded URL, a link to a document Note
  • 5.
    UML Basic StructuralModeling 5 Adornments: Note • Examples See URL Shuttle.nasa.gov Mission full_name : string Shuttle start_engines() stop_engines() fuel_level() : integer launch(t:time) Launch time is computed from ephemeris
  • 6.
    UML Basic StructuralModeling 6 Stereotypes • Allows to extend the vocabulary of the UML • Allows to create new building blocks, specific to your problem • Can be applied to any element (Class, Attribute, Operation, …) • Can be represented by << stereotype >> new icon both
  • 7.
    UML Basic StructuralModeling 7 Stereotypes a class can have a stereotype indicating what basic type of class it is (e.g. controller, actor, interface) represent a metaclassification of the class appear within guillemets in normal type above the class name Window size : Area = (100, 100) visibility : Boolean = invisible display () hide () «user interface»
  • 8.
    UML Basic StructuralModeling 8 Operation Stereotypes stereostypes can also be used to group together operations with common characteristics represent a metaclassification of the operation BadSocket throw() log (String) «helper» setSocket(Socket) «access» getID():SocketID setID(SocketID) «exception»
  • 9.
    UML Basic StructuralModeling 9 Stereotypes Examples Shuttle weight : Integer age : Integer status: enum = on-ground << NASA Object >> Spacecraft
  • 10.
    UML Basic StructuralModeling 10 Tagged Values • Apply to any element of the UML • Metadata that applies to the element not its instances • Represent arbitrary information expressed in text form • Commonly used to store Project Management information • Examples: author of an element Author=John Smith testing status Test = No version number Version # = 4.2
  • 11.
    UML Basic StructuralModeling 11 Constraints restrict the values that object or links can assume expressed as arbitrary expressions enclosed in braces near the constrained elements often use navigation expressions constraints between two elements are depicted using a dotted, labeled line Astronaut Member-of Crew Commander-of {subset} 4..6 * *1
  • 12.
    UML Basic StructuralModeling 12 Constraint Examples employer CompanyemployeePerson boss worker {person.employer = person.boss.employer} * *