Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个问题已经在很多方面进行了解释,但仍然没有让我清楚。
似乎两种模式都使用继承来创建对象。
对象组合是指对象由某物组成。它基本上是策略模式,使两个对象具有“has-a”关系,而不是“is-a”关系(如直接继承)。