C # language Learning--several principles of object-oriented

Source: Internet
Author: User

Five basic principles:
Single Duty principle (Single-resposibility Principle): A class, it is best to do only one thing, only a change that causes it. The principle of single responsibility can be regarded as the extension of low coupling, cohesion in object-oriented principle, defining responsibility as the cause of change, in order to improve cohesion to reduce the cause of change.
Open closure principle (Open-closed principle): Software entities should be extensible and non-modifiable. That is, open to the extension, to modify the closed.
Liskov substitution principle (Liskov-substituion Principle): Subclasses must be able to replace their base classes. This idea is embodied in the constraints of inheritance mechanism, only the subclass can replace the base class, it can ensure that the system in the runtime to identify the subclass, which is the basis of ensuring inheritance reuse.
Dependency inversion principle (Dependecy-inversion Principle): dependent on abstraction. In particular, high-level modules do not rely on the underlying modules, both of which are dependent on abstraction;
Interface Isolation principle (Interface-segregation Principle): Use multiple small dedicated interfaces instead of a large total interface

Solid

C # language Learning--several principles of 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.