Talk about the status quo:
Causes of short-lived projects:
1, the original function can not be more effective split merge, business can not be extended or modified very difficult;
2, modification is more, the same method directly modified and inconvenient to modify;
3, the program itself when the design of strong coupling, repair changes large;
4, post-modification is only a patch, even the patch is problematic.
Reasons for the short-lived project despite repeated prohibitions:
1, encoding degrees of freedom. Real projects are not so random as to write logic between classes and classes. But in the study of the time to develop the habit.
2, the analysis of demand is too optimistic, underestimated the technical difficulties, did not consider the post-business expansion
"Simple" does not mean that the function is simple, but the lack of flexibility, only the project can be used, to get other items is garbage, such code is "one-time code." Our focus is on reusing "code".
Design patterns complicate simple things, but here we need to know that the code of the design pattern is a universal key that can be adapted to a variety of situations, rather than a single occasion.
Broadly, it can be divided into three broad categories.
Behavioral patterns are concerned with the reuse and maintenance of code, and enhance the reusability of code.
Introduction to Design Patterns