Business requirements: "Clean apples-" eat apples "
Object-oriented is a kind of thinking, not the use of the class is the use of object-oriented.
Object-oriented is not the problem itself, the problem itself can be handled through an object-oriented architecture. For example, "clean apple-" Eat apple "this function.
The process needs to deal with business events, design and write corresponding processing functions, control the implementation of the steps, the first to achieve "cleaning apples", and then processing "eat apples" problem.
1. In object-oriented understanding, he should have completed a function in two steps, we want to implement a controller, and this control process is an "abstract function", which will be used, encapsulation, inheritance, polymorphism. The above-mentioned Apple event is just a subclass of "abstract functional body".
A. The above-mentioned business object-oriented approach is not about the "Apple event", but rather the problem of such a process, the event is a real Apple case, he cleaned apples, ate apples, as he can achieve "business demand type" one.
B. The bottom of this feature should be an abstract controlled object, and our needs should be an actual functional class (about Apple).
2. In the process of orientation, it is possible to focus the thought on the function itself.
For Apple events, write a large number of functional code, through overloading and judgment, to the Apple event to maintain the possible changes. But the whole process revolves around the Apple event itself, and when the Apple event is abandoned, all functions are discarded.
Simply talking about object-oriented