UML (Unified Modeling Langauage)
UML (Unified Modeling Langauage)
Advantages:
To represent complete systems (instead of only the software portion) using
object-oriented concepts
To establish an explicit coupling between concepts and executable code
To take into account the scaling factors that are inherent to complex and
critical systems
To creating a modeling language usable by both humans and machines
UML Diagrams
UML defines nine different types of diagram:
2. Activity Diagram:
Used to document complex use case logic. It is not required for simple use case
logic.
Symbols:
Sequence diagrams show essentially the same information, but concentrate on the
time-ordered communication between objects, rather than their relationships. An
example of a sequence diagram is shown below. The dashed vertical lines
represent the lifeline of the object:
3. Sequence Diagram:
4. Collaboration Diagram:
Class
Attribute1
Attribute2
MethodA()
MethodB()
The top part showing the class name, the second showing the attributes and the third
showing the methods.
Relationships:
3.1 If A depends on B, then this is shown by a dashed arrow between A and B, with the
arrowhead pointing at B:
1. Bidirectional:
Aggregation:
Composition:
Composition, on the other hand, is shown by a black diamond on the end of association next
to the composite class. If B is composed of A, then B controls the lifetime of A.
Multiplicity:
A multiplicity can also be a range of values. Some examples are shown below:
0..1 Either 0 or 1
Naming an Association
To improve the clarity of a class diagram, the association between two objects may be
named:
Inheritance
The next diagram represents the case where class C is derived from classes A and B:
Withdrawal Class:
Withdrawal
- from: int
- amount: Money
+ Withdrawal(atm: ATM, session: Session, card: Card, pin: int)
# getSpecificsFromCustomer(): Message throws Cancelled
# completeTransaction(): Receipt
Visibility of Attribute or Method specified by characters like - (Private), + (Public), #
(Protected).
7. State Diagram:
8. Component Diagrams:
Deployment diagrams show the physical layout of the various hardware components
(nodes) that compose a system, as well as the distribution of executable programs on
this hardware.
Deployment diagrams may show node classes or node instances. As with other types of
diagram, the graphical difference between classes and objects is implemented by
underlining the object name. The following example shows the deployment diagram of a
building access management system:
Each process named in the deployment diagram executes a main program with the same
name as the one described within the component diagram.