OO Basics
Abstraction
Encapsulation
Polymorphism
Inheritance
OO principles
Encapsulation changes
Multi-Purpose Combination and less inheritance
For interface programming, not for implementation programming
Efforts to design loose coupling of interaction objects
Class should be open to extensions and closed to changes
Dependency abstraction, not dependent on detailed classes
Just talk to friends
Don't look for me, I will look for you
Class should have only one reason for change
OO Mode
State mode-agree to change the behavior of an object when its internal state changes. The object seems to have changed its class.
1. The State mode allows an object to have different behaviors based on its internal state.
2. Unlike the program state machine, the state mode uses classes to represent the State.
3. context will entrust the behavior to the current State object.
4. By encapsulating each State into a class, we will localize whatever changes need to be done in the future.
5. The status mode and Policy mode have the same class diagram, but they have different intentions.
6. The context class is usually configured using behaviors or algorithms in the Policy mode.
7. The state mode allows context to change behavior as the state changes.
8. State conversion can be controlled by the state class or context class.
9. Using the status mode will usually cause a large number of classes to be added in the design.
10. The status class can be shared by multiple context instances.
[Design mode] Status Mode