A class uses composition when it holds an object of another class as a member (“has a”) and calls it, rather than deriving from it (“is a”). A member may be held by value, or by reference or pointer to an object of an abstract class, in which case the behaviour it provides can be chosen at run time.
书籍暂未推出简体中文版——当前显示英文版。
Computer Science · 术语表