I know the class object interface, but I don't know how to construct class behavior attributes for a project. ask the younger brother. I should read that book ~

Source: Internet
Author: User
I now know the class object interface, but I don't know how to construct class behavior attributes for a project. I should read that book ~~ I now know the class object interface, but I don't know how to construct class behavior attributes for a project. I should read that book ~~ Example ~~ Very confused ~, I think we should read books on system design, software engineering, especially object-oriented design, the name looks like I now know the class object interface, but I don't know how a project should structure class behavior attributes. could you please read the book in that area ~~
I now know the class object interface, but I don't know how to construct class behavior attributes for a project. I should read that book ~~



Example ~~ Very confused ~

------ Solution --------------------
I think you should read the system design books.
------ Solution --------------------
Software engineering books, especially object-oriented design,
The name may look like "object-oriented programming ".
------ Solution --------------------
Let's take a look at PHP object-oriented, patterns and practices for 10 times.
------ Solution --------------------
The teacher draws a circle on the blackboard.
The teacher draws a triangle on the blackboard.
The teacher draws a circle on the paper.
------ Solution --------------------
Discussion

The upstairs is good. Where can I define this painting line?

------ Solution --------------------
The book on the 4th floor is not recommended currently, because it is not an object-oriented introductory book. most of the OO analysis/design/programming books are written in java/c ++ and php, but are not recommended. so, go to the java book

Your question on the 7th floor: "Should I write the picture (circle) as a person, a blackboard, or a circle"
My answer is: yes.
Because of the "painting" action, all three of them are involved, and they are indispensable. implementation on either side is possible.
This is what you need to decide in the design phase, and may change during refactoring.
Where can it make your design easier to understand, simpler, and so on...

At the same time, consistency should be maintained during design. for example, there should not be a "painting" in "teacher" or a "painted" in "circle ",
This is confusing, and it is likely to be repeated code. Similarly, if there is "painted" in "circle" and "square", there should also be "painted ",
In this case, you can abstract this "painted" to their abstract parent class "shape ....

When you face different needs, you will find that different designs will bring different feelings and consequences,
Therefore, compared with the example of "virtual", it is better to directly write a small actual project (such as a small bbs ?)
In this way, it is easier to make the requirements more specific, and you can write the actual code, so that you can better understand.


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.