The better alternative USES composition rather than inheritance, as illustrated in Figure 3.
较好的替代方案就是采用组合而不是继承,如图3所示。
The third alternative is to provide a common capability, but using associations instead of inheritance.
第三种方法是提供一种通用的功能,但采用的是关联而非继承。
Multiple dispatch does not merely generalize polymorphism, it also provides a more flexible alternative to inheritance in many contexts.
多分派不仅仅泛化了多态性,它还在许多上下文中提供了更加灵活的继承方式。
应用推荐