Understanding the three basic characteristics of object-oriented is the basis of understanding the five basic principles of object-oriented.Three major features are: encapsulation, inheritance, polymorphismThe so-called encapsulation , that is, to encapsulate objective things into abstract classes, and classes can be t
Open interfaces and hide details-the principle of opening and closing based on the basic object-oriented principles
We know that the code we have written has undergone multiple tests. For example, you need to pass unit testing and integration testing by developers, then go to White-box testing and black-box testing by testers, and finally perform certain tests b
Three main features of object-oriented design: 3. encapsulation and object-oriented
Add a new assembly:
Right-click solution-add-new project-class library
Select Main project-reference-right-click to add reference
Using assembly
Class access modifier:
The class has
control and coordinate the services of other objects; knowing what data is inside Know which objects have a relationship with themselves
Knowing the type of responsibilities is manifested by the properties of the inner encapsulation of the class and the relationships between the classes, so the previous discussion of the properties of the class and the relationship between the classes is the process of assigning the known responsibilities to the classes in Fishigui.
Job-making is done b
Objective-c object-oriented basics, objective-c object-oriented
Currently, mobile development is booming. Today, I am studying the recently started Objective-c basic tutorial at home. n
Understanding the three basic characteristics of object-oriented is the basis of understanding the five basic principles of object-oriented.Three major features are: encapsulation, inheritance, polymorphismThe so-called encapsulation, that is, to encapsulate objective things into abstract classes, and classes can be th
This article mainly introduces the PHP object-oriented interface isolation principle (ISP), detailed analysis of the concept of interface isolation, principles, use of methods and related operational considerations, the need for friends can refer to the following
In this paper, the principle of interface Isolation (ISP) of PHP
Object-Oriented Programming principles
1. Single Responsibility Principle (the principle of clear object responsibilities)
Requirement: a single object can only do one thing and must be focused. There are many reasons for too many responsibilities that may cause changes, a
Before formally introducing the design model, let's briefly introduce the basic object-oriented principles.
1. Single Responsibility Principle
Its core idea is: A class, it is best to do only one thing, only one that causes its changes
2. Open and closed principles
The c
Fully understanding the three basic features of object-oriented is the basis for understanding the five basic principles of object-oriented.
Three features: encapsulation, inheritance, and Polymorphism
The so-calledEncapsulation refers to encapsulating objective objects
specific programming, because the abstraction is relatively stable. Let the class depend on the fixed abstraction, such modification is closed, but through the object-oriented inheritance and the polymorphism mechanism, can realize the inheritance of the abstract body, by covering its methods to change the inherent behavior, to implement a new extension method, so for the extension is open.
1) Apply the id
Six Basic Principles
single Duty: A class only does what it has to do (high cohesion). In object-oriented, if only one class is allowed to do what it should do, and not to design an area unrelated to it is to practice the principle of high cohesion, this class has only a single responsibility.
Open closure : Softwa
Object-oriented three basic characteristics and five basic principles
(1) Three basic characteristics: encapsulation, inheritance, polymorphism
Encapsulation:Refers to the abstraction of objective things into classes, and each class protects its own data and methods. A class can put its own data and methods only to allow trusted classes or objects to operate
, "I don't need a lot of things!" Uncle Schopenhauer once said: "Just as a country that does not need or needs very little to import goods, is the luckiest country, likewise, if a person is abundant and rich and does not need to seek amusement from outside of himself, then this person is the luckiest person." because imported goods make the country expensive, rely on others, but also bring danger, create trouble. "Lao Tzu said:" Tone deaf deaf, colored blind, gallop the field is crazy. Chuang Tz
expatriates should be able to participate in the lucky draw. Otherwise, the company will not be harmonious.
The dependency inversion principle dip depends on the specific abstraction, and the upper layer depends on the lower layer. Assume that B is a lower module than a, but B needs to use the function of,At this time, B should not directly use the specific class in a: instead, B should define an abstract interface and a will implement this abstract interface. B only uses this abstract interfac
. Dimitri Law Dimitri (lawofDemeter) is also known as the least knowledge principle (Least knowledge Principle Shorthand LKP ), which means that an object should have as little knowledge of other objects as possible , don't talk to strangers. The English shorthand is : LoD. The Dimitri Law can be simply said: Talk your immediate friends . for OOD , it is also explained in the following ways: a software entity should interact with as few interactions
-side function code, you can increase the client function implementation code, which requires that at the beginning of the design, the server should be separated from the client, the public part of the abstraction.4, rely on the inverted principle layer of mobile phone operating system class depends on the underlying Apple. The class of MilletAn example that satisfies the dependency inversion principle relies on abstraction not to rely on the figurati
Ten principles of Object Oriented Software development (turn one)
It is useful for developers to look back at the application. Consider whether the application has achieved the intended purpose? Did you follow the best scenario? Is there a better way to achieve the goal? Knowing new, you may find new ideas in retrospect.
This paper presents 10 state-of-the-art
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.