5.29 principles of design patterns

One,

  Lee substitution principle means that the method can not modify the parent class, not the parent class can be added with a local parent class can be a subclass.

 

  For example, a single responsibility principle means that the interface has washing trash and methods, Xiao Ming is only responsible for washing dishes, Xiao Ming implement this interface has to override the method trash but not realized. In fact, a dishwasher should write two interfaces interfaces interfaces a trash, garbage Xiao Ming interface can be achieved, in line with the principle of single responsibility.

Guess you like

Origin www.cnblogs.com/wym591273/p/10941759.html