UML basics UML distilled, a brief guide to the standard Modeling language, by Martin Fowler, 2000
ATM scenario from Object-Oriented Modeling and Design, by J.Rumbaugh, 1991 The ATM asks the user to insert a card The ATM accepts the card and reads its serial number The ATM requests the password The ATM verifies the serial number and password with the consortium, the consortium checks it with the bank and notifies the ATM of acceptance The ATM asks the user to select the kind of transaction (withdrawal, deposit, …). The user select withdrawal The ATM asks for the amount of cash The ATM verifies that the amount is within predefined policy limits and asks the consortium to process the transaction. The consortium passes the request to the bank, which eventually confirms success and returns the new account balance The ATM dispenses cash and asks the user to take it The ATM asks whether the user wants to continue, the user indicates no The ATM prints a receipt, ejects the card, and asks the user to take them The ATM asks a user to insert a card
Class Diagrams Associations –Associations ends –Role names –Multiplicity –navigability Uni/Multidirectional Generalization Constrains
Aggregation / Composition
Many to many associations and link
Modeling an association as a class
Association Class
Role names for directory hierarchy
Ordering Qualified association
Interfaces and Abstract Classes Generalization Realization Dependency
Derived Associations and Attributes
Qualified Association
Sequence Diagram
Collaboration Diagram
State Diagram
Super State
Activity Diagram
Composite Activity
Swimlanes
ATM scenario from Object-Oriented Modeling and Design, by J.Rumbaugh, 1991 The ATM asks the user to insert a card The ATM accepts the card and reads its serial number The ATM requests the password The ATM verifies the serial number and password with the consortium, the consortium checks it with the bank and notifies the ATM of acceptance The ATM asks the user to select the kind of transaction (withdrawal, deposit, …). The user select withdrawal The ATM asks for the amount of cash The ATM verifies that the amount is within predefined policy limits and asks the consortium to process the transaction. The consortium passes the request to the bank, which eventually confirms success and returns the new account balance The ATM dispenses cash and asks the user to take it The ATM asks whether the user wants to continue, the user indicates no The ATM prints a receipt, ejects the card, and asks the user to takes them The ATM asks a user to insert a card
ATM Sequence diagram
Exercises
(X + Y/2) / (X/3 + Y)
Categorize relationships 1.A country has a capital city 2.A person use a fork 3.A file is an ordinary file or a directory file 4.Files contains records 5.A polygon is composed of ordered set of points 6.A drawing object is text, a geometrical object or a group 7.A person use computer language on a project 8.Modem and keyboard are input / output devices 9.A person plays in a team in certain year 10.A rout connects two cities 11.A studen takes a course from a professor
State diagram 1.Caller lifts receiver 2.Dial tons begins 3.Caller dials digit (5) 4.Dial tons ends 5.Caller dials digit (5) 6.Caller dials digit (5) 7.Caller dials digit (1) 8.Caller dials digit (2) 9.Caller dials digit (3) 10.Caller dials digit (4) 11.Called phone beings ringing 12.Ringing tones appears in calling phone 13.Called party answers 14.Called phone stops ringing 15.Ringing phone disappears in calling phone 16.Phones are connected 17.Called party hangs-up 18.Phones are disconnected 19.Caller hangs-up
State Diagram