Академический Документы
Профессиональный Документы
Культура Документы
What is UML?
UML = Unified Modeling Language A language for visualizing, specifying, constructing and documenting artifacts of software-intensive systems. Examples of artifacts: requirements, architecture, design, source code, test cases, prototypes, etc. UML is suitable for modeling various kinds of systems: 1) enterprise information systems, 2) distributed web-based, 3) real-time embedded system, etc.
2
Elements
Can be classified in two categories: 1) elements used in structural diagrams 2) elements used in behavioral diagrams
Structural Elements
1) Artifact 2) Class 3) Collaboration 4) Collaboration Occurrence 5) Component 6) Deployment Specification 7) Interface 8) Node 9) Object 10) Package 11) Part 12) Port 13) Qualifiers
5
Behavioral Elements
1) Action 2) Activity 3) Actor 4) Boundary 5) Choice 6) Decision 7) Exception 8) Join 9) Lifeline 12) Use Case 10) Object 11) Package
6
Structural Elements
a) static part of the model to represent conceptual elements b) nouns of the model We illustrate: 1) class 2) interface 3) collaboration 4) component 5) node
7
Element 1: Class
1) description of a set of objects that share the same attributes, operations, relationships and semantics 2) implements one or more interfaces 3) graphically rendered as a rectangle usually including a name, attributes and operations 4) can be also used to represent actors, signals and utilities
Element 2: Interface
1) collection of operations that specifies a service of a class 2) describes the externally visible behaviour, partial or complete, of a class 3) defines a set of operation signatures but not their implementations 4) rendered as a circle with a name
Element 3: Collaboration
1) defines an interaction between elements 2) several elements cooperating to deliver a behavior, rather than individual behavior 3) includes structural and behavioral dimensions 4) represents implementations of patterns of cooperation that make up a system 5) represented as a named ellipse drawn with a dashed line
10
Element 4: Component
1) physical, replaceable part of a system that conforms to and provides the realization of a set of interfaces 2) represents deployment components such as COM+ or Java Beans components 3) represents a physical packaging of logical elements such as classes, interfaces and collaborations 4) it can also be used to represent applications, files, libraries, pages and tables
11
Element 5: Node
1) a physical element, exists at run time 2) represents a computational resource with memory and processing capacity 3) a set of components may reside in a node 4) components may also migrate from one node to another 5) graphically modeled as a cube
12
Behavioral Elements
a) represent behavior over time and space b) verbs of the model We illustrate: 6) use case 7) activity 8) actor 9) package
13
14
Element 7: Activity
1) is the specification of a parameterized sequence of behavior 2) specifies the coordination of executions of subordinate behaviors, using a control and data flow model 3) may contain actions of various kinds:
occurrences of primitive functions, such as arithmetic functions. invocations of behavior, such as activities communication actions, such as sending of signals. manipulations of objects, such as reading or writing attributes or associations.
15
Element 8: Actor
1) is a user of the system, including:
a) a human user b) a machine c) another system
2) is anything that interacts with the system from the outside or system boundary 3) does not necessarily represent a specific physical entity:
a single physical entity may play the role of several different actors, a given actor may be played by multiple physical entities
16
Element 9: Package
Grouping element of UML: 1) organizes diagrams 2) primary kind of grouping and decomposition 3) conceptual, only available at development time 4) graphically represented as a tabbed folder
17
Relationships
Four basic types of relationships: 1) dependency 2) associations 3) generalization 4) realization Meanings are consistent with the basic Object Oriented relationship types described earlier.
18
Relationship 1: Dependency
A semantic relationship between two elements in which a change to one element (independent element) may affect the meaning of another (dependent element). Given as a directed dashed line possibly with a label:
19
Relationship 2: Association
1) a structural relationship describing a set of links 2) links are connections between objects 3) aggregation is a special type of association depicting the whole-part relationship 4) association is presented as a solid line, possibly directed, labeled and with adornments (multiplicity and role names)
20
Relationship 3: Generalization
1) a relationship in which objects of a specialized element (child) are substitutable for objects of a generalized element (parent) 2) child elements share the structure/behavior of the parent 3) rendered graphically as a solid line with hollow arrowhead pointing to the parent
21
Relationship 4: Realization
1) a semantic relationship between elements, wherein one element specifies a contract and another guarantees to carry out this contract 2) relevant in two basic scenarios:
a) interfaces versus realizing classes/components b) uses cases versus realizing collaborations
3) graphically depicted as a dashed arrow with hollow head, a cross between dependency and generalization
22
Diagrams
A diagram is a graph presentation of a set of elements and relationships where: a) nodes are elements b) edges are relationships Can visualize a system from various perspective, thus is a projection of a system.
23
Diagram Types
24
Diagram 1: Class
Class Diagrams: 1) show a set of classes, interfaces and collaborations, and their relationships 2) address static design view of a system
25
26
Diagram 2: Object
Object Diagrams: 1) show a set of objects and their relationships 2) static snapshots of element instances found in class diagrams
27
28
Diagram 3: Component
Component Diagrams: 1) show the organization and dependencies amongst a set of components 2) address static implementation view of a system 3) show how components map to one or more classes, interfaces and collaborations
29
30
31
32
Diagram 5: Package
Package Diagrams: show the organization of packages and their elements provide a visualization of the namespaces.
33
34
Diagram 6: Deployment
Deployment Diagrams: show configuration of run-time processing nodes and the components hosted on them address the static deployment view of an architecture are related to component diagram with nodes hosting one or more components
35
36
37
38
Diagram 8: Activity
Activity Diagrams: show control/data flows from one activity to another address the dynamic view of a system, useful for modeling its functions emphasize the flow of control among objects
39
40
Diagram 9: State
State Diagrams: show a state machine consisting of states, transitions, events, and activities address the dynamic view of a system are important in modeling the behavior of an interface, class or collaboration emphasize the event-driven ordering
41
42
43
44
46
47
48
50
UML Summary 1
A model provides a blueprint of a system. UML is a language for visualizing, specifying, constructing and documenting artifacts of software-intensive systems. UML is process-independent but recommended for use with processes that are: 1) use case driven, 2) architecture-centric, 3) iterative, and 4) incremental.
51
UML Summary 2
There are three building blocks which characterize UML: 1) elements, 2) relationships, and 3) diagrams. Elements can be classified based on the diagrams they are used: 1) structural diagrams 2) behavioral diagrams There are four basic types of relationships in UML: dependency association generalization realization
52
UML Summary 3
UML provides 13 diagrams for modelling: 1) class diagrams 2) object diagrams 3) component diagrams 4) composite structure diagrams 5) package diagrams 6) deployment diagrams 7) use case diagrams 8) activity diagrams 9) state machine diagrams 10) sequence diagrams 11) communication diagrams 12) timing diagrams 13) interaction overview diagrams
53