Conceptual summary of Design principles
Read the design patterns of Zen, the design principles to do a summary of the concept, if you want to better understand, or to see the specific details, this side can only be a rough summary, as a learning note. Principle of single responsibility
English Name: Single Responsibili
Preface
The Zen of design patterns is tied to this book. When I went to the library to borrow a book in the next semester of my junior year, I saw a new book with a title containing the word "Zen, at that time, he was infatuated with Steve Jobs. Therefore, whatever the messy content it writes, you can use it to get it back to the dormitory. Next, during the summe
Preface
"Zen of design patterns" saw 78th pages. Continue to stick to it! As a creation-type design model, the factory method model is frequently used. Therefore, the learning of this model is quite valuable. So what is the definition of this mode? What is the implementation of this mode? What is the role of this model? I will do everything possible for readers t
is metadata? The data used to describe the environment and data, in layman terms, are configuration parameters that can be obtained from a file or from a database.-----> Develop Project Charter(1) Norm-setting, unified style programming-----> Package Changes(1) The package of changes contains two meanings: first, the same change is encapsulated in an interface or abstract class. Second: The different changes are encapsulated in different interfaces or abstract classes, and there should not be t
day good face is also beautiful still need to modify, this time, there is a big kill device appeared-the design is limited, can not indefinitely consider the future change situation, otherwise it will fall into the mire of design can not extricate themselves.Maintain the purity of the interface1, the interface as small as possible, with a single responsibility conflict priority to consider the principle of
submodule or business logic;Through the business logic compression interface in the public method, the interface often to review, as far as possible to get the interface to "flesh", rather than "fat doodle" a lot of methods;has been contaminated with the interface, as far as possible to modify, if the risk of a large change, the use of adapter mode for conversion processing;Understand the environment and refuse to follow blindly. Each project or product has specific environmental factors, don't
- Letterprocess.fillenvelope (address); + //Pack Envelopes A Letterprocess.letterinotoenvelope (); at //Send a letter - Letterprocess.sendletter (); - } -}View Code"4" Client test1 PackageCom.yeepay.sxf.template18;2 /**3 * Client Testing4 * @authorSXF5 *6 */7 Public classClienttest {8 9 Public Static voidMain (string[] args) {Ten //Letter of Business class OneIletterprocess letterprocess=NewLetterprocessimpl (); A //Letter of Business class façade c
weigh repeatedly, not only to make the structure clear, but also to achieve high cohesion and low coupling.---> Dimitri Law requires decoupling between classes, but the decoupling is limited, the principle is only for reference, if it violates this principle, the project may not fail, which requires you to use the principle of repeated measures, do not follow is not correct, strict implementation is "too bad."Iv.: Central idea(1) in a scene, the A,b,c class. Complete a goal. A relies on b,b to
type T, and the return value of the same method (overloaded or overridden) of the subclass is S, then the Richter substitution principle requires s to be less than or equal to T.
3. Dependency inversion principle (DIP):
The high-level module should not rely on the bottom low-layer module, both should rely on its abstraction;
Abstraction should not depend on details;
Detail should be dependent on abstraction.
The dependency of a PS object is passed in three waysOne, the construct
Preface
Today, I started to learn the first mode of 23 design modes-singleton mode. I have read many blog posts about Singleton mode on the Internet. Today, I am going to explain the design patterns in the Zen of design patterns. The author is still very careful. The only pity is that the author explained the singleton
} - - the}View Code"4" policy wrapper1 PackageCom.yeepay.sxf.template13;2 /**3 * Policy Wrapper4 * High-level module invocation is very simple,5 * know which strategy to use, produce its object, and then put it in the wrapper role to complete the task.6 * @authorSXF7 *8 */9 Public classContext {Ten One PrivateStrategy strategy=NULL; A - PublicContext (Strategy strategy) { - This. strategy=strategy; the } - //Kam SAC Performers - Public voi
Summary
No program can run without a user interface. Even if the middle-Layer Code is perfect, users cannot use it. Many architects do not pay much attention to the presentation layer. They only process the presentation layer as a detail after the business layer and data access layer are completed. However, the user interface, business logic, and data access code are equally important in any system. Your at
Some time ago, I finally got my long-awaited book "Zen of design patterns", but for work reasons, there is no time to calm down and savor the Zen words from my work practices. I put this book in front of my bed. Whenever I go to bed, I will flip it over. I have read some books on design patterns before, but I want to g
stories" of the Bible ". This book is the "Zen" of the Bible. It is not as esoteric, obscure, or difficult as the Bible, because of the treasure of words such as gold and character, it is more profound and comprehensive than the "Comments" version of the "Bible", more popular and vivid, closer to the practical scenarios encountered by developers, and more instructive. This book is a milestone in the field of desi
Reprint: http://www.javaweb1024.com/java/Javajichu/2015/04/09/535.htmlDesign pattern of Zen First second edition http://www.javaweb1024.com/info/403.jspxThe 7th chapter of the single case model7.1 I am the emperor, my only one.Since the Qin Shihuang established the position of the emperor, the same period is basically only one person sitting alone in this position. In this case the subjects are also good to deal with, when we bow down, talk about the
Zen-interface isolation principle in Design ModeTwo types of interfaces: (1) instance Interface (2) Class Interface, use Interface-defined Interface isolation: (1) the client should not rely on interfaces that it does not need (2) the dependency between classes should be based on the smallest interface. Scenario Description: you are bored on the street one day, shouting a beautiful girl on the street. As a
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.