An object-oriented understanding

Source: Internet
Author: User

Object-oriented is relative to process-oriented, object-oriented and process-oriented is a kind of thought.

The process-oriented approach is based on a functional perspective, emphasizing each functional step, representing the language: C language.

Object-oriented is an object- based approach to the problem, emphasizing the object, called by the object function method, representing the language: Java, C + +, C #.

Give an example to compare
Example: Put an elephant in a refrigerator for a total of several steps
To understand the process-oriented thinking is:
1. Open the refrigerator.
2. Store Elephants.
3. Close the refrigerator.
What we emphasize is "open", "store", "close" These functional behaviors,
The visual representation of these behaviors in code is a function or method,
This is a process-oriented <<< with functional behavior as the main body >>> thought embodiment.
To understand the process-oriented thinking is:
1. The refrigerator is turned on.
2. Refrigerator storage.
3. The refrigerator is closed.
As you can see, all operations are based on the "refrigerator" object, not the functional behavior as the main body.
In other words, the refrigerator itself already has the "open", "storage", "close" behavior function, we only need to let the refrigerator perform its functions can be.
This is an object-oriented <<< execution function of the object >>> as the main body of thought embodiment.

Object-oriented is a thought that conforms to the thinking habit, when we need to fulfill some kind of demand:
Start by looking for objects with the required functionality.
If the object does not exist, create a << >> object with the required functionality.

An object-oriented understanding

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.