(Article classification: Java programming 1 Policy mode section
*The four basic concepts of object-oriented (00) are: abstraction, encapsulation, inheritance and polymorphism.
Software design principle: encapsulate changes - separate the parts of the software that may change in the future and separate them from other parts to reduce the impact of changes on them. Such a design can make the system elastic and better respond to changes.
Software design principle: the program is an interface, not an implementation. According to this principle, variables are declared as supertypes (interfaces or abstract classes) rather than implementation classes.
*The benefit of inheritance is code reuse.
*Software developers spend more time "after" than "before". Now that software development has been completed, we should focus on improving the degree of reuse to achieve maintainability and scalability.
Software design principle: use more combinations and less inheritance. Using composition method can realize code division, make code more flexible and improve reusability better.
Policy pattern: define a group of algorithm families, which are encapsulated separately, so that each algorithm can be replaced with each other. This mode allows the algorithm to be changed independently of the client using the algorithm.)