Académique Documents
Professionnel Documents
Culture Documents
UML
UML
District Module
Order Initiated
Order Approved
Database Server
Delivery Status
Sign-Shop Module
Order Filled
UML
UML
History
CASE Tools: Automation of Software Development People-to-People People-to-Computer Rational Software (An IBM Company) Rational Rose / MS Visio: Converting UML-Diagrams-to-Programs OMG: Object Management Group
UML
History
Booch: Booch Method Rumbaugh: OMT (object modeling tech.) Jacobson: OOSE (OO software engrg.) Three amigos: UML
UML
History
UML: an open standard controlled by OMG UML 1.0 (1997) UML 2.0 (2004)
UML
Meta-Model
a diagram that defines the notation to be used in the modeling language
UML
package deployment
activity state/statechart
UML Wolfgang Pelz 2000-04
9
Brief Overview
class - set of classes, interfaces, collaboration, relationships object - set of objects and their relationships use case - description of functionality provided by system along with actors and their connection to the use case
UML
10
Overview (cont.)
interaction - set of objects and their relationships including messages state/statechart - a state machine showing states, transitions, events, and activities activity - statechart sequential flow of activities component - physical structure of code in terms of code components
UML Wolfgang Pelz 2000-04
11
Overview (cont.)
deployment - physical architecture of hardware and software in the system package - shows packages of classes and dependencies among them
grouping mechanism form of class diagram also called subsystem
UML
12
Organization of Diagrams
domain expert use case activity interaction system designer class component deployment state package
UML
13
Another Organization
static class component package deployment dynamic use case interaction state activity
UML
14
Another Organization
UML
15
Model Terminology
user model view - problem and solution from the perspective of the users structural model view - static or structural aspects of a problem and solution behavioral model view - dynamic or behavioral aspects; interactions or collaborations among problem and solution elements
UML Wolfgang Pelz 2000-04
16
Model Terminology
implementation model view - structural and behavioral aspects of the solutions realization environment model view - structural and behavioral aspects of the domain in which a solution must be realized
UML
17
UML
18
UML
19
Terminology
inception - a few days work to decide if a few months of elaboration is worth it elaboration - risk assessment, about 1/5 of project time; includes planning based on use cases; generates a commitment schedule construction - composed of iterations that include refactoring, frameworks & patterns transition - beta testing, optimizing, training
UML Wolfgang Pelz 2000-04
20
Refactoring
the process of changing the internal structure of a program or system to make it easier to understand or change while maintaining its functionality
UML
21
UML
23
Class Diagram
static view of a system in terms of classes and relationships among the classes
associations subtypes
typically done in parallel with interaction diagrams a more graphical alternative to CRC cards
UML Wolfgang Pelz 2000-04
24
Important Questions
(Finding classes) Is there information to be stored/analyzed? Do external systems exist? Are there patterns, class libraries, components, etc? Must the system handle devices? Are there organizational parts (business model)? Do actors have roles to play in the system?
UML Wolfgang Pelz 2000-04
25
Common Uses
Objective: provide a view of services the system should provide to its end user model the vocabulary of a system model simple collaborations model a logical database schema
UML
26
Terminology
association: a description of a related set of links between objects of two classes subtype: is a or is a kind of generalization: relationship between a more general and a more specific element - see subtype
UML
27
Terminology (cont.)
dependency: relationship where a change in the independent element affects the dependent element refinement: relationship between two descriptions of the same thing, but at different levels of abstraction
UML
28
Terminology (cont.)
Aggregation: association specifying a whole-part relationship between the aggregate (whole) and a component (part). An aggregation may not have any components and a component may not belong to any aggregation. composition: special form of aggregation (a component must belong to a composition and only to one composition)
strong ownership coincident lifetime of parts and whole
UML Wolfgang Pelz 2000-04
29
Notation
UML
30
More Notation
UML
31
Aggregation/Composition
UML
32
Example
UML
33
Levels of Abstraction
conceptual model: class name
associations are conceptual relationships
Another Example
UML
35
Associations
Describe relations between classes associations have roles (given at the end of the association) which have multiplicities associations have navigability
A sends a message to B A creates an instance of B A needs to maintain a connection with B
Associations (cont.)
navigability in one direction is termed unidirectional association and has an arrow two-way navigability is bi-directional association and has no arrow an association with no arrow could also mean that the direction is unknown bidirectional requires inverse relationship
f ( f -1(y)) = y
UML
f -1( f (x)) = x
Wolfgang Pelz 2000-04
37
Operation Signatures
visibility name (parameters) : return type optional optional + public # protected - private
polymorphism forces a distinction between the two (all siblings have the same operation but different methods)
UML Wolfgang Pelz 2000-04
39
Another Example
UML
41
Cautions
start small perspective should match activity
analysis: conceptual model software: specification model
UML
42
Dependency Relationship
One element (of any kind, including classes, use cases, etc.) has knowledge of another element if one element changes, the other might have to change as well differs from plain attribute visibility which uses regular association line and a navigability arrow
UML Wolfgang Pelz 2000-04
43
Example revisited
UML
44
UML
45
Interface
Interface is a class of abstract/pure virtual functions. All functions in the interface are public. Interface cannot be used to instantiate objects. There is no data members in an interface class. UML: use <<interface>> to prefix the class name.
UML Wolfgang Pelz 2000-04
46
Abstract Class
An abstract class has one or more abstract/pure virtual functions. An abstract class cannot be used to instantiate objects. An abstract class can contain data members. UML: use Abstract to prefix the class name.
UML
47
UML
48
Chapter 6
Object Diagrams
UML
49
Object Diagrams
A snapshot of the objects in a system at a point in time. Also called instance diagrams. Useful of showing object connections (not interactions) Can be thought of as collaboration/communication diagram without messages. Naming convention (did not change as sequence diagram did):
UML
50
UML
51
UML
52
UML
53
Notation
UML
55
UML
56
UML
57
Common Uses
to model the context of a system
system, actors, and their interactions with it
58
Caution
it is easy to get too low-level
A use case is a relatively large end-to-end process description that typically includes many steps or transactions; it is not normally an individual step or activity in a process.
Larman [1998] Applying UML and Patterns
UML Wolfgang Pelz 2000-04
59
Steps
capture normal case first for every step, ask: What can go wrong How might this work differently each variation is plotted as an extension common behavior can be encapsulated in another use case to be used by other cases
UML Wolfgang Pelz 2000-04
60
Steps (cont.)
after creating the diagram, write a generic scenario (called a use case description) which is a series of sentences describing each step in the interaction Each step in a use case is an element of the interaction between an actor and the system. use case description can be used to generate specific scenarios and interaction diagrams
UML Wolfgang Pelz 2000-04
61
Scenario
a thread through a use case a sequence of steps describing an interaction between a user and a system. A use case is a set of scenarios tied together by a common user goal.
UML
62
Exercise
Produce a use case diagram for an ATM
UML
63