Design patterns

In contrast, an object's type only refers to its interface--the set of requests to which it can respond.

An object can have many types,and objects of different classes can have the same type.

Creational patterns ensure that your system is written in terms of interfaces,not implementions.

principle of object-oriented design

1.Program to an interface , not an implementation.

2.Favor object composition over class inheritance.

原文地址:https://www.cnblogs.com/jiangzhen/p/2376361.html