/20071205214949530.html of interface segregation principle (ISP)-OO design, we introduce a class-oriented design principle:
Clients shocould not be forced to depend upon interfaces that they do not use. users cannot be forced to rely on interfaces they do not use.
Applying this concept to a wider range of packages is the basic concept of CRP: do not combine cla
30-minute understanding of Object-Oriented Design Principles
Many people have read the design patterns, but Martin does not have much estimation on the object-oriented
principles.d) "Conflict" in the principles of inheritance and combinatorial aggregation multiplexingInheritance can also be reused, is that the principle of abandoning inheritance? No.Inheritance pays more attention to "descent", which is what type. Combinatorial aggregation is more focused on borrowing "skills". Also, in combinatorial aggregation, two classes are part-to-whole relationships, and combinatorial aggregation can consist of multiple clas
Seven principles: Open and close principle, Richter substitution principle, dependency reversal principle, synthesis/aggregation multiplexing principle, Dimitri rule, interface isolation principle, single duty principle.The open and closed principle is the cornerstone of object-oriented reusable. The other six principles
11 principles of object-oriented design
Single Duty principle (the Responsibility Principle , abbreviation SRP )
Open-Close principle (the Open-close Principle , abbreviated as OCP )
Liskov Replacement principle (the Liskov Substitution , hereinafter referred to as LSP )
Dependency Inversion principle (the De
improve the maintainability of the system.The object-oriented design principle and design pattern are also the compass to reconstruct the system rationally, and the reconstruction (refactoring) is to improve the quality and performance of the software by adjusting the program code without changing the existing functio
depend upon details, details should depend upon abstractions.Another expression is:to program for the interface, do not program for implementation. The English definition is:Program to a interface, not an implementation.analysis of dependency reversal principleThe dependency reversal principle was Robert C. Martin's third engineering notebook in 1996 for the C + + Reporter column, which he later joined in
Object-oriented design principles are at the heart of oops programming, but most of the Java programmers I've seen are enthusiastic about design patterns like Singleton (singleton), Decorator (adorner), OBSERVER (Observer), Instead of focusing enough attention on learning
"/"; return NewChu ($a,$b); Break; Case"%"; return NewQuyu ($a,$b); Break; } } } $j= Gongchang::d uixiang (3,2, "%");//Test Echo $j->js ();//OutputOutput resultsSecond, the design of six major principles1. The open-close principle is that the design should have good support for the extension, and the modification should be strictly limited.2. On the Richter scale also, the subclass mu
1. Opening and closing principle (the Open Closed principle OCP)
A module should be open in terms of extensibility and should be closed in terms of modification. Therefore, the interface encapsulation mechanism, abstract mechanism and polymorphic technique should be considered as far as possible in object-oriented design. The principle is also suitable for non
Labels: OCP Java design mode Object-Oriented Design1. Single Responsibility Principle
The core idea of a single responsibility principle is: every object in the system should have only one independent responsibility, and all objects are concerned with the completion of their own responsibilities. SRP single Responsibil
. Dependency inversion principle: high-level modules do not depend on low-layer modules, both of which are dependent on abstraction. Or just the example: Duck is a high-rise module, Fly is a low-level module. Duck does not depend on fly, the high-rise module changes slowly, while the lower-level modules change slowly.Abstractions should not be dependent on implementation details, and implementation details should be dependent on abstraction. Fly is an abstraction, it does not depend on how to fl
In the previous article, we talked about the design patterns. Next, let's talk about some of the principles we often follow in object-oriented design. These principles are the result of numerous previous experiences. Only by follo
Object-oriented design principles are at the heart of oops programming, but most of the Java programmers I've seen are enthusiastic about design patterns like Singleton (singleton), Decorator (adorner), OBSERVER (Observer), Instead of focusing enough attention on learning
Just like the location of Newton's three major laws in classical mechanics, the open-closed principle is the cornerstone of object-oriented reusable design (Object Oriented Design or OOD. Other
Object-oriented design principles are at the heart of oops programming, but most of the Java programmers I've seen are enthusiastic about design patterns like Singleton (singleton), Decorator (adorner), OBSERVER (Observer), Instead of focusing enough attention on learning
Just like the location of Newton's three major laws in classical mechanics, the Open-Closed Principle is the cornerstone of object-oriented reusable Design (Object Oriented Design or OOD. Other
Just like the location of Newton's three major laws in classical mechanics, the open-closed principle is the cornerstone of object-oriented reusable design (Object Oriented Design or OOD. Other
Seven Principles of object-oriented design and seven
Today we will talk about seven principles, namely: single responsibility, Lishi replacement, dimit law, dependency reversal, interface isolation, synthesis/aggregation principle, and openness-closure.
1. Open and Close
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.