2008/03/25 2008/03/25 Unified Modeling Lanauage Unified Modeling Lanauage 1 Introduction to Introduction to Unified Modeling Unified Modeling Language Language (UML) – Part One (UML) – Part One Ku-Yaw Chang Ku-Yaw Chang [email protected][email protected]Assistant Professor Assistant Professor Department of Computer Science and Information Department of Computer Science and Information Engineering Engineering Da-Yeh University Da-Yeh University
25
Embed
2008/03/25 Unified Modeling Lanauage 1 Introduction to Unified Modeling Language (UML) – Part One Ku-Yaw Chang [email protected] Assistant Professor.
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Assistant ProfessorAssistant ProfessorDepartment of Computer Science and Information EngineeringDepartment of Computer Science and Information Engineering
UML 2.0 defines 13 diagrams, divided into UML 2.0 defines 13 diagrams, divided into two general sets:two general sets: StructuralStructural modeling diagrams modeling diagrams
Define the static architecture of a modelDefine the static architecture of a model Classes, objects, interfaces and physical componentsClasses, objects, interfaces and physical components
Model the relationships and dependencies Model the relationships and dependencies between elementsbetween elements
BehavioralBehavioral modeling diagrams modeling diagramsCapture the varieties of interaction and Capture the varieties of interaction and instantaneous state within a model as it 'executes' instantaneous state within a model as it 'executes' over time. over time.
Package diagramsPackage diagrams Divide the model into logical containers or 'packages' Divide the model into logical containers or 'packages'
and describe the interactions between them at a high and describe the interactions between them at a high levellevel
Class or Structural diagramsClass or Structural diagrams Define the basic building blocks of a model: the types, Define the basic building blocks of a model: the types,
classes and general materials that are used to classes and general materials that are used to construct a full modelconstruct a full model
Object diagramsObject diagrams Show how instances of structural elements are Show how instances of structural elements are
related and used at run-time. related and used at run-time.
Composite structure diagramsComposite structure diagrams Provide a means of layering an element's structure Provide a means of layering an element's structure
and focusing on inner detail, construction and and focusing on inner detail, construction and relationshipsrelationships
Component diagramsComponent diagrams Model higher level or more complex structures, Model higher level or more complex structures,
usually built up from one or more classes, and usually built up from one or more classes, and providing a well defined interfaceproviding a well defined interface
Deployment diagramsDeployment diagrams Show the physical disposition of significant artifacts Show the physical disposition of significant artifacts
within a real-world setting within a real-world setting
Use case diagramsUse case diagrams Model user/system interactions.Model user/system interactions. Define behavior, requirements and constraints in the Define behavior, requirements and constraints in the
form of scripts or scenariosform of scripts or scenarios
Activity diagramsActivity diagrams Define basic program flowDefine basic program flow Capture the decision points and actions within any Capture the decision points and actions within any
generalized processgeneralized process
State machine diagramsState machine diagrams Understanding the instant condition or "run state" of a Understanding the instant condition or "run state" of a
Communication diagramsCommunication diagrams Show the network and sequence of messages or Show the network and sequence of messages or
communications between objects at run-time during a communications between objects at run-time during a collaboration instancecollaboration instance
Sequence diagramsSequence diagrams Show the sequence of messages passed between objects using Show the sequence of messages passed between objects using
a vertical timelinea vertical timeline
Timing diagramsTiming diagrams Fuse Sequence and State diagrams to provide a view of an Fuse Sequence and State diagrams to provide a view of an
object's state over time and messages which modify that state object's state over time and messages which modify that state
Interaction overview diagramsInteraction overview diagrams Fuse Activity and Sequence diagrams to provide allow Fuse Activity and Sequence diagrams to provide allow
interaction fragments to be easily combined with decision points interaction fragments to be easily combined with decision points and flows and flows
A use caseA use case A description of a set of sequences of actionsA description of a set of sequences of actions Rendered as an ellipseRendered as an ellipse
NamesNames A simple nameA simple name
A path nameA path namePrefixed by the name of the packagePrefixed by the name of the package
ContentsContents Use casesUse cases ActorsActors Dependency, generalization, and association Dependency, generalization, and association
relationshiprelationship
Common UsesCommon Uses To model the To model the contextcontext of a system of a system
All things on the outside that interact with the system All things on the outside that interact with the system constitute the system’s contextconstitute the system’s context
To model the To model the requirementsrequirements of a system of a system
A relationshipA relationship A connection among thingsA connection among things
The three most important relationshipsThe three most important relationships DependenciesDependencies GeneralizationsGeneralizations AssociationsAssociations
A change in specification of one thing may affect A change in specification of one thing may affect another thing that uses it, but not necessarily the another thing that uses it, but not necessarily the reversereverse
Be rendered as a dashed directed lineBe rendered as a dashed directed line Directed to the thing being depended onDirected to the thing being depended on
To decompose use cases into reusable To decompose use cases into reusable partspartsTwo stereotypesTwo stereotypes ExtendExtend
Specify that the target use case extends the Specify that the target use case extends the behavior of the sourcebehavior of the source
IncludeIncludeSpecify that the source use case explicitly Specify that the source use case explicitly incorporates the behavior of another use case at a incorporates the behavior of another use case at a location specified by the sourcelocation specified by the source
A relationship betweenA relationship between A general thing (called the superclass or parent)A general thing (called the superclass or parent) A more specific kind of that thing (called the subclass A more specific kind of that thing (called the subclass
or child)or child)
Also called an “Also called an “is-a-kind-ofis-a-kind-of” relationship” relationshipRendered as a solid directed line with a large Rendered as a solid directed line with a large open arrowhead, pointing to the parent.open arrowhead, pointing to the parent.
A structural relationshipA structural relationship Specify that objects of one thing are connected to Specify that objects of one thing are connected to
objects of anotherobjects of another
Rendered as a solid line connecting the same or Rendered as a solid line connecting the same or different classesdifferent classes
Four adornmentsFour adornments NameName RoleRole MultiplicityMultiplicity AggregationAggregation
MultiplicityMultiplicity How many objects may be connected across an How many objects may be connected across an
instance of an associationinstance of an association Exactly one (1)Exactly one (1) Zero or one (0..1)Zero or one (0..1) Many (0 ..*)Many (0 ..*) One or more (1..*)One or more (1..*)