Study Notes on design patterns (2)------TraditionalOoDesign limitations
Chapter 3An urgent need for flexibilityCodeProblems
What is an expert system:
The expert system is a special computer system that uses the rules of human experts to automatically make decisions. Creating an expert system involves two steps. First, obtain the rules used by experts to make decisions and complete tasks, and model these rules. Second, implement these rules in the computer; this step usually uses some commercial Expert System Tools. For analysts, the first step is much more difficult.
In this chapter, the author tells a story aboutCAD/CAMSystem.
The same method must be used from differentCAD/CAMInformation is extracted from the system. This allows the company to continue working on a costly expert system.
Chapter 4A standardOoSolution
In the previous chapter, we made a solution. The problem was solved using huge inheritance. However, implementation relies heavily on inheritance, which leads to a higher maintenance cost. In addition, this method has several disadvantages: high redundancy, low cohesion, and class explosion.
According to this design and implementation, it is definitely an abuse system and needs to be re-designed.
The authors of these two chapters guide readers through practical examplesOoTo solve the problem. Using a traditionalOoAfter the method, the system can be used, but there are many defects, which will lead to difficulties in maintenance and expansion in the future. Maybe the design pattern can provide better solutions.
Trackback: http://tb.blog.csdn.net/TrackBack.aspx? Postid = 559056