12.5 Identifying Objects’ States and Activities
[Note: This section can be taught after Chapter 5.]
In Section 12.4, we identified many of the class attributes needed to implement the ATM system and added them to the class diagram in Fig. 12.12. We now show how these attributes represent an object’s state. We identify some key states that our objects may occupy and discuss how objects change state in response to various events occurring in the system. We also discuss the workflow, or activities, that objects perform in the ATM system, and we present the activities of BalanceInquiry
and Withdrawal
transaction objects.
State Machine Diagrams
Each object in a system goes through a series of states. An object’s state is indicated by the values ...
Get Java How to Program (early objects), 9/e now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.