() {transferer. expenditure (amount); payer. deposit (amount) ;}} class Start1 {public void Main () {bank account Zhang San = new bank account {card number = 111, balance = 10000 }; bank account Li Si = new bank account {card number = 222, balance = 5}; bank transfer operation transfer = new bank transfer operation (); Transfer. amount = 1000; transfer. transferor = James; transfer. recipient = Li Si; transfer money. transferring money () ;}} copying code S
Solid is an abbreviation for several important coding principles
Srp:the Single Responsibility Principle sole responsibility principle
Ocp:the Open Closed Principle opening and closing principle
lsp:the Liskov Substitution Principle Richter Replacement principleLd:the Law of Demeter Dimitri
Isp:the Interface Segregation Principle Interface separation principle
Dip:the Dependency Inversion Principle depen
reversal) is by Robert? C. Martin's acronym for memorization, introduced in the early 21st century [1], refers to the five basic principles of object-oriented programming and object-oriented design. When these principles are applied together, they make it more possible for a programmer to develop a system that is easy
the programmer should have the-solid principle of artistic temperament. S.O.L.I.D is the acronym for several important coding principles (programming Priciple) in object-oriented design and programming (Oodoop).
SRP
The single Responsibility Principle
Single Responsibility Principle
Ocp
The Open Closed Principle
Ope
object-oriented design process, under specific scenarios, and between classes and communicating with each other.? A deep understanding of object-oriented is the basis of learning design patterns, mastering certain object-oriented design principles can grasp the essence of object-oriented
Become a senior architect first to understand the design pattern, before understanding, to understand the design principles, the original I ate this loss, a long time to someone asked me design principles, I am a dazed, not only design
Labels: Easy SRP als construction for building subclass applications
Solid principles that every developer should know
Single Responsibility Principle (SRP)
Why does it violate SRP?
What problems will this design bring in the future?
Open/closed principle (OCP)
How to Make It (animalsound) conform to OCP?
LSP)
I
creating models. certainly got people get value out of these aspects of OO. the principles, however, focus very tightly on dependency management.
Dependency management is an issue that most of us have faced. whenever we bring up on our screens a nasty batch of tangled legacy code, we are experiencing the results of poor dependency management. poor dependency managment leads to code that is hard to change, fragile, and non-reusable. indeed, I talk abo
In-depth understanding of the JavaScript series: the principle of solid five principles of interface isolation ISPObjectiveIn this chapter we are going to explain the 4th of the S.o.l.i.d Five principles of JavaScript implementation, the interface isolation principle of the ISP (the Interface segregation Principle).English Original: http://freshbrewedcode.com/der
, including the parent class of the exported class, regardless of the order or quantity of the definition, and do not move all virtual functions, either in order or in quantity.When exporting a class design, remember not to export anything other than a function.It is recommended that when you publish the DLL of the exported class, you redefine the declaration of a class, which can be listed in the declaration of the class, regardless of the member var
instability makes its internal code easier to modify. So if a component is stable, then he should include some abstract classes so that he can be extended.Reuse Publishing Equivalence PrincipleObjectiveRobert C. Martin has summarized the principles that should be followed in object-oriented design (OOD), which are known as "
S.O.L.I.D is the acronym for several important coding principles (programming Priciple) in object-oriented design and programming (Oodoop).
SRP
the single Responsibility principle
single responsibility principle
OCP
the Open Closed principle
LSP
The Liskov Substitution Principle
Richter substitution principle
needWorkaround:1, use the delegate to separate the interface. 2, using multiple inheritance to separate the interface. 3. Split the bloated interface I into separate interfaces, and Class A and Class C are dependent on the interfaces they need. That is, the principle of interface isolation.Summary: We in the code writing process, the use of interface isolation principle, must be moderate, the interface design
reasons such as the need to modify the original code of the software, may introduce errors in the old code, or we will have to refactor the entire functionality, and the original code needs to be tested again. This has a special impact on our entire system, which also fully shows the coupling of the system if too high, will greatly increase the later expansion, maintenance. In order to solve this problem, people have summed up the principle of opening and closing. The fundamental solution to th
Interestingly, the Five Principles of OO can be abbreviated as one word:Solid(Stability and stability) In fact, an organization should be stable. If it is not internally united (cohesion), how can it be stable! If cohesion is not high, the internal revolution will happen when there is a new change!
How to explain solid? It is actually the first letter of the five words:
1.S:Single Responsibility Principle
software organization has only the minimum knowledge of other units and is limited to software units closely related to the same unit.
Dimit rules and Design PatternsFacade mode and mediator Mode
Make people ignorantThe third chapter of Lao Tzu said: "It is based on the governance of saints, and lacks its heart, its belly, and its ambition. It often makes the people ignorant and heartless. The "Ignorance" of the "ruling" object is in the "Ignorance"
The main purpose of my article is to introduce the principles of high quality design for a subset of classes and interfaces. These guidelines should not only ensure that the design and implementation of the class or interface itself has high-quality code, but more importantly in the industrial field should be as much as possible to update and maintain the code do
attaches great importance to the guidance of programming styles. It is extremely important to establish a good aesthetic. Kent Beck: "I'm not a great programmer; I'm just a good programmer with great habits. "Deng Hui, translator of Agile Software Development: Principles, models, and practices, has his opinion:" code quality is the most direct and fundamental embodiment of software quality, the so-called design
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.