Modeling ATM
Modeling ATM
Engineering:
Using UML, Patterns and Java, 3rd
Edition
Bernd Bruegge, Allen Dutoit
Exercise: Modeling with UML
1) Model an ATM
Draw a use case diagram for an ATM (cash terminal). The system includes two
actors: a customer, who draws money from his account either on the money
chip on his bank card or in cash, and a security man, who fills money into the
ATM.
Use cases should include: DrawCash, LoadMoneyChip, CheckAccountBallance, FillATM. Also
include the following exceptional cases: OutOfMoney, TransactionAborted (i.e.,
customer selected the cancel button without completing the transaction) and
MoneyChipOutOfOrder.
Remark: It is possible to use inheritance between use cases!
Write the flow of events and specify all fields for the use case CheckAccountBalance
that you drew before. Specify relationships.
Solution:
1/7
Object-Oriented Software
Engineering:
Using UML, Patterns and Java, 3rd
Edition
Bernd Bruegge, Allen Dutoit
Exercise: Modeling with UML
2) Model a book
Draw a class diagram representing a book defined by the following statement:
“A book is composed of a number of parts, which in turn are composed of a
number of chapters. Chapters are composed of sections.” First, focus only on
classes and associations.
2/7
Object-Oriented Software
Engineering:
Using UML, Patterns and Java, 3rd
Edition
Bernd Bruegge, Allen Dutoit
Exercise: Modeling with UML
Consider the refined class diagram. Note that the Part, Chapter, and Section
classes all include a title and a number attribute. Use inheritance to factor out
these two attributes .
Solution:
1.)
Book
1
*
Part
1
*
Chapter
1
*
Section
2.)
3.)
3/7
Object-Oriented Software
Engineering:
Using UML, Patterns and Java, 3rd
Edition
Bernd Bruegge, Allen Dutoit
Exercise: Modeling with UML
Solution:
Figure 2
4/7
Object-Oriented Software
Engineering:
Using UML, Patterns and Java, 3rd
Edition
Bernd Bruegge, Allen Dutoit
Exercise: Modeling with UML
Solution:
Solution:
5/7
Object-Oriented Software
Engineering:
Using UML, Patterns and Java, 3rd
Edition
Bernd Bruegge, Allen Dutoit
Exercise: Modeling with UML
6/7
Object-Oriented Software
Engineering:
Using UML, Patterns and Java, 3rd
Edition
Bernd Bruegge, Allen Dutoit
Exercise: Modeling with UML
7/7