Skip to content

Composition

OOP composition

wikipedia Object composition

Aggregation and composition

Aggregation is a kind of composition

Delegation and composition

delegation是基于composition而实现的,在wikipedia Object composition中,有这样的描述:

Delegation may enrich composition by forwarding requests or calls made to the enclosing composite object to one of its internal components.[3]

delegation将在后面章节进行描述。

Has-a relation

1、参见 Composition-over-inheritance 章节

2、wikipedia Has-a

Generic programming composition

参见:

1、 Theory\Programming-paradigm\Generic-programming章节

2、C++\Standard-library\STL章节