CPlusOOP
SiteMap
Project Cycle
System Design
UML
System Design
«Prev
System Object Design
Analysis Design
Review Project Life Cycle
Transition Analysis Design
Analysis Work Products
Two-Step Design
Process Phase Conclusion
Architectural Analysis
Partitioning Analysis Model
Partitioning Process Goal
Partitioning Design Conclusion
Domain Partitioning
Domain Partitioning Resources
Package Modeling Purpose
Three Step Domain Partitioning Process
Partitioning based On Use Cases
Define Dependencies between Partitions
Domain Partitioning Conclusion
Architectural Partitioning
Design Strategies
Two-Tier Architecture
Three Tier Architecture
Partitioning Architecture ntier
Additional ntier Architectures
Deployment Diagram
Architectural Analysis Conclusion
Object Design
Object Design Tools
Statechart Diagram
Review Statechart Notation
State Design Pattern
State Behavior Conclusion
Statechart to Object Design - Quiz
State Design Pattern Description
1) Create an attribute in the base class called 'status' or 'state' or something similar to convey its purpose.
2) For each state in the statechart diagram, create a corresponding class definition.
3) Draw a generalization relationship from each state object to a single superclass.
4) The data type of the state/status attribute of the base class should refer to the new superclass (this will allow the base class to refer to any of the state subclasses through this attribute). The aggregation symbol is commonly used to indicate that the state generalization is a 'part of' the make-up of the base class.
5) For each event in the state transition diagram: a) Add a corresponding interface to the base object. b) Add a corresponding (identical) interface to the state superclass (this will cause every state subclass to inherit the interfaces).
6) To implement the base object interfaces, invoke the corresponding interface on the attribute that holds the state subclass reference.