databaserのブログ -16ページ目

databaserのブログ

ブログの説明を入力します。

Definition: A software entities such as classes, modules and functions should be open for extension, closed for modification. The origin of the problem: in the software life cycle, because other changes, upgrades and software maintenance reasons need to modify the existing code, it might give the old code, introduce errors, it may make us have to reconstruct the whole New Nike Free Run 3 Shoes Women Navy Womens function, and the need for the original code has been re-tested. Solution: When the software needs to be changed, as far as possible by extending the behavior of software entities to achieve change, rather than by modifying the existing code to implement change. Closing object-oriented design principles is the most basic design principles that guide us in how to build a stable and flexible system. Principles of opening and closing may be defined six principles of design patterns one of the most obscure, it only tells us open for 2015 Nike Free 5.0 extension, closed for modification, but in the end how to do open for extension, closed for modification, and did not explicitly tell us ʱ?? Previously, if someone told me, 'When you carry out the design must comply with the principle of opening and closing,' I would feel Nike Free 3.0 that he did not say anything, but it looks like and what is said everything. Because the opening and closing principle really Void. Thinking carefully and read the articles many design patterns, and finally have a little understanding of the principles of opening and closing. In fact, we follow the principles of design patterns in front of five, and the purpose of the use of 23 kinds of design patterns is to follow the principle of opening and closing. That is, as long as we abide by the principles of the previous five well designed software is naturally in line with the principle of opening and closing, opening and closing of this principle is more like the previous level of compliance with the five principles of 'average score', in front of 5 compliance with the principle of good, average natural high, indicating compliance with the principle of opening and closing software design good; if the previous five principles of New Nike Free 5.0 V4 Shoes Black Red New Nike Tr Fit Shoes Blue compliance is Air Max 2012 Black Red White not good, then the opening and closing observance of the principle of good. In fact, I believe that the opening and closing to express this principle is nothing more than a layer of meaning: a framework for building abstract, with the details to achieve expansion. Because abstract flexibility, adaptability, as long as the abstract SALOMON rationality, you can basically stable software architecture. The software in variable details, we use abstract derived from the implementation class to be extended when the software needs to change, we just need to re-derive an implementation class on demand to extend it. Of course, only if we abstract to be reasonable, to changes in demand for forward-looking and predictable job. Here, again recall said earlier five principles, it is precisely tell us a framework for building abstract, with details of the precautions to achieve expansion only: Single Responsibility Principle tells us to achieve a single class to duty; Richter substitution principle tells us not inheritance system damage; Dependency Inversion principle tells us to oriented programming interface; Interface Segregation Principle tells us in the design of the interface time to streamline the single; Demeter tells us to reduce the coupling. The opening and closing principle is master, he told us to open for Air Max 2012 Blue Grey White extension, closed for modification. Finally, explain how to comply with these six principles. It does not comply with these six principles are and no questions, but more and fewer problems, that is, we generally do not say there is no compliance, but to say how much the degree of compliance. Anything is too far, six design principles of design patterns is the same, the development of these six principles of our purpose is not to follow their rigid and need flexibility in the use of the actual situation. As long as their level of compliance within a reasonable range, even if it is good design. We Air Max 2012 Blue Silver White use a diagram to explain. Each dimension in the figure each represent a principle, we based this principle on the level of compliance in the dimension drawing a point, if you follow this principle of reasonable, then this Nike Air Max point should fall inside the red concentric circles; If compliance is poor, the point will be in the small circle inside; if excessive compliance point will fall outside the great circle. A good design is reflected in the figures, it should be six vertices of a hexagon in concentric circles. In the figure, design 1, design 2 belong to a well-designed, the extent of their compliance with the six Air Jordan Outlet New Nike Free 5.0 V4 Shoes Black Blue principles are within a reasonable range; design 3 design 4 design although some shortcomings, but basically acceptable; design five serious lack of principles are not well respected; designed to comply with six transition, the design 5 and 6 are the urgent need to reconstruct the design of the design. Here, six principles of design patterns to finished. The main reference books are 'design mode' 'Zen' Design Patterns 'Westward design mode' and some scattered articles online, but the main content is mainly New Nike Free 5.0 V4 Shoes Black Blue my own perception of these six principles. Write out the purpose of these six principles on the one hand is to sort out Nike Blazers Low the system, on the one hand but also with the majority of users to share, because the design mode for programmers is indeed very important. Just as we have a saying in the eyes of a New Nike Free 5.0 V4 Shoes Black Red thousand thousand readers Hamlet, if you understand these six principles differ with me, welcome message, we discuss. Below are links 1. Single Responsibility Principle front five design principles (Single Responsibility Principle) 2. Richter substitution principle (Liskov Substitution Principle) 3. Dependency Inversion principle (Dependence Inversion Principle) 4. Interface Segregation Principle (Interface Segregation Principle) 5. The Law of Demeter (Law Of Demeter) and in order to facilitate the collection of friends wanted, below word version of the download. Download Link word version: six principles of design patternssix principles of design patterns (6): the principle of opening and closing