Maintainability Support System (Maintainability), to enhance reusability of the system (Reuseability)
---------------------> For object-oriented software system design is a core issue.
1. The principle of opening and closing (Open-Closed Principle, OCP): a software entity to deal with the expansion of open, closed for modification.
2. Where's substitution principle (LSP): If the use of a software entity is a base class, then must apply to sub-class, and it could not aware of the parent class object and sub-class object
Distinction. Subtype must be able to replace their parent types.
3. Rely on the reverse principle (DIP): to rely on the abstract, do not depend on the concrete.
4. Interface segregation principle (ISP): use of multiple specialized interface than using a single interface is better overall.
5. Synthesis / polymerization of the principle of multiplexing (CARP): a new target in the use of some existing object, by assigning to achieve these have been the object of reuse has been the purpose of function.
6. Dimitr law (LoD): that is, at least knowledge of the principles of an object to other objects as small as possible to understand. Can be understood as the rule in order to reduce the cost of object
Know better.
The face of demand changes to the procedure is carried out by adding new code, rather than change the existing code.
Close to the suffering of happy open
High cohesion and low coupling.
Interface-oriented programming.
High-level modules should not rely on low-level module. Both should not rely on the abstract.
Only if the subclass can replace the parent category, the software function units affected, the parent can really be reused, and the subclass can
In the parent based on the addition of new behavior.
Richter substitution because of the principle that makes an open - closed as possible.
It is because of sub-types can only make use of alternative types of modules parent is no need to change in circumstances can be extended.
Agreed interface.
In fact, to rely on reverse can be said to be a sign of object-oriented design, and programming language which is not important, if the preparation of
To consider are how to abstract the details of programming rather than programming, that is, procedures for all of the dependencies are
Terminate in the abstract class or interface, that is, object-oriented design, on the contrary it is a design process
Decorative patterns have been functional for more features to dynamically add a way.
When the system needs new features, it is the old type to add new code. The new code is usually added to the original decoration of the core functions or types of main actors.
In the main category to add a new field, new methods and new logic, thus increasing the complexity of the main categories.
These new things just to satisfy some only in certain specific circumstances under which it will conduct the implementation of special needs.
Decorative pattern provides a very good solution, it is necessary to decorate each of the functions on a separate category,
And let this type of packaging it to be the object of decoration, therefore, when the need to implement special behavior, the client code at run time can be selected according to need,
In order to target the use of decorative features of the packaging.
The type of decorative feature in the move to remove from the category, so that the original category can be simplified.
Effective type of core functions and the distinction between decorative function. Related and can be repeated to remove the decorative logic.
Deputy mode: for other clients, a proxy to control access to this object.
Proxy mode applications:
Remote Agent, that is, for an object in different address space provided by local representatives of. This can hide an object
Exists in the fact that different address space.
Virtual agent is based on spending a great need to create the object. Through its example of the need to store a long time the real object.
Simple factory pattern is that the greatest advantage of the factory class that contains the necessary logic to determine, in accordance with the conditions of the client the choice of dynamic instantiation
Related categories, the client is in addition to specific products and dependence.







