Aggregating allows any number of extensions to be added, without the need for defining all possible combinations of subclasses.
聚合允许添加任意数量的扩展,而无需定义子类的所有可能的组合。
For example, a method that operates on Numbers might only want to accept instances of number or its subclasses.
比如,一个操作各种Number类的方法可能仅仅需要接收Number类或者它的子类对象。
For example, a method that operates on Numbers might only want to accept instances of number or its subclasses.
比如,一个操作各种Number类的方法可能仅仅需要接收Number类或者它的子类对象。
应用推荐