类继承层次结构(class inheritance hierarchy structure) 在多继承情况下,我们要求所有的类都具有一个共同的超类,从而构成一个格状结构(Lattice). .
基于6个网页-相关网页
这还不利于域类的设计,因为这个实用类现在必须位于对象层次结构的顶层,不允许您使用继承来整合常见行为。
It also hurts the design of your domain classes because this utility class must now sit at the top of your object hierarchy, not allowing you to use inheritance to consolidate common behavior.
实现层次结构在Scala中的效果是相同的:我们可以向方法应用final来防止子类覆盖它,也可应用于类声明本身来防止继承。
Implementation hierarchy works the same way in Scala: We can apply final to the method to prevent a child class from overriding it or to the class declaration itself to prevent derivatives.
我们还看到所有这些对象都可以包含多个 TAG/DataElement,因为该组合是在对象继承层次结构的父类(DICOMData)中表示的。
We also see that all these objects can contain a number of TAG/DataElements since this composition is represented at the parent of the object inheritance hierarchy (DICOMData).
应用推荐