Simply talking about object-oriented

Source: Internet
Author: User
Tags apple event

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.