I l@ve RuBoard |
9.6 Lifecycles for ClassesRecall the definition of a class. A class is an abstraction of a set of real-world things such that
Since all instances of the class must follow the same rules of behavior, when we abstract a group of like things to produce a class, we also abstract their common behavior pattern into a lifecycle typical of the class. The lifecycle provides a formal description of the behavior pattern shared by each of the objects, called a state machine, as illustrated in Figure 9.12. Figure 9.12. Correspondence between Abstraction as a Class and as a State MachineJust as a class has instances, so a state machine also has instances. A state machine instance refers to the execution of a state machine by a particular object. Think of a state machine instance as a private copy of the state machine that is executed by a single object. Each state machine instance is in exactly one state at a time. |
I l@ve RuBoard |
No comments:
Post a Comment