如何基于国情走中国建筑文化的创造之路,作者建议应抽象继承、迁想妙得;
How to create the new way of architectural culture of China on the basis of national situation?
更深入的概念,如抽象关联,或者抽象继承,也是RDL语言的一部分,但是本文将不作介绍。
Advanced concepts like abstract relations, or relation inheritance, are also part of the RDL language, but they will not be covered in this article.
请记住,您需要为类添加必要的继承抽象方法。
Remember that you need to add the necessary inherited abstract methods for your class.
如果某项操作被宣布为抽象的那么继承的类必须提供了一个具体的实施方案。
If an operation is declared as abstract then the inheriting class must provide a concrete implementation.
要使用ABC,子类必须继承自此 ABC 并且还要覆盖其抽象方法。
To use an ABC, a subclass must inherit from the ABC and override its abstract methods.
一个类(不管是抽象的还是具体的)实现一个接口并不真正从它实现的接口继承任何东西。
A class (whether abstract or concrete) that implements an interface does not really inherit anything from the interface it implements.
同时提供接口和抽象类是多余的,但我发现这样很方便:在大多数情况下,我只需要抽象类,但接口支持多继承性。
Offering both an interface and an abstract class is redundant, but I find it convenient: in most cases, I only need the abstract class, but the interface enables multiple inheritance.
支持接口的每项服务或代理必须继承定义该接口的抽象基类。
Each service or proxy that supported an interface was required to inherit from the abstract base class that defined the interface.
在创建自定义集合时,不用自己实现整个接口,只是继承抽象实现并填入细节。
Instead of implementing the entire interface yourself when creating a custom collection, you just subclass the abstract implementation and fill in the details.
而FoodOrder则是由这三种食品类型实际订单类(Doughnut、Pasty和IcedBun)继承的另一个抽象类。
Food order is another abstract class inherited by the three food types actual order classes: Doughnut, Pasty, and IcedBun.
在显示的窗口中,指明您希望eclipse创建继承的抽象方法。
In the window that displays, specify that you want Eclipse to create the inherited abstract methods.
应当注意,option对象本身是一个抽象对象,只用于定义其他对象将继承的属性。
It should be noted that the option object itself is an abstract object and is only used to define properties for other objects to inherit.
想要开发这样一个抽象,实现者需要从_ templated类继承,如清单13所示。
Implementers who want to exploit an abstraction such as this need to inherit from the _templated class, like in the Listing 13.
由于Python支持多重继承,抽象可以达到相当有害的复杂程度。
Because Python supports multiple inheritance, abstraction can be taken to a level of complexity that is quite unhealthy.
不需要定义契约检查操作的控制逻辑,因为它继承自清单2中的前辈AbstractContract抽象方面。
You don't need to define the control logic of the contract-checking operation, because it's inherited from the ancestor AbstractContract abstract aspect in Listing 2.
在Eclipse中创建一个完成Connection接口的新类(称它为MockConection),检查为继承的抽象方法产生桩模块的选项(见图2)。
Create a new class in Eclipse (call it MockConection) that implements the Connection interface. Check the option to generate stubs for inherited abstract methods (see Figure 2).
Class的抽象可由子类化和一种灵活的基于mixin的组合机制(它可作为多重继承的简单替代方案)来扩展。
Class abstractions are extended by subclassing and a flexible mixin-based composition mechanism as a clean replacement for multiple inheritance.
顶层对象是Order,是FoodOrder和BoxOrder继承的一个抽象类。
The top level object is the Order, an abstract class that is inherited by FoodOrder and BoxOrder.
通过调用 DL_Dxf对象的in函数并将指针传递给一个继承 DL_CreationAdapter抽象类来打开此文件。
You open the file by calling the in function of the DL_Dxf object and passing a pointer to a class that inherits from the DL_CreationAdapter abstract class.
在开发自己的组件时,需要继承uicomponentbase,它扩展了UIComponent并提供了UIComponent中所有抽象方法的默认实现。
When you develop your own components you will subclass UIComponentBase, which extends UIComponent, and provides default implementations of the all of the abstract methods in UIComponent.
抽象操作类继承了org.apache.struts.action.Action并实现了execute方法。
The abstract action class extends org.apache.struts.action.Action and implements the execute method.
继承抽象类的子类必须实现在其父类或自身中声明为抽象的所有抽象方法。
A child class that extends an abstract class must implement all abstract methods in its parent or itself be declared abstract.
通过扩展来进行继承是一种常见的面向对象设计,很容易通过在U ML中显示抽象类来表达这种继承。
Inheritance by extension is a common object-oriented design and is easily expressed through showing abstract classes in UML.
这种句法决策使您在抽象类继承的实现方面有一定的灵活性。
This syntactical decision gives you a degree of flexibility in the implementation of abstract-class derivatives.
操作类继承的抽象类也已被创建以保存所有的操作类实现所需的共同代码。
An abstract class that our Action classes extend has also been created, to hold common code needed for all our Action class implementations.
而且,因为两个映射的类(Building和Land)是从estate中继承而来,所以我们可以在HQL查询中使用这个抽象超类,如清单14所示。
And, since our two mapped classes (Building and Land) inherit from Estate, we can use this abstract superclass in our HQL queries, as shown in Listing 14.
从技术的角度上来看oop其实就是对于数据类型的抽象,继承和多态,但是其他的问题也很重要,我会在下面的章节里提到这些问题。
Technically, OOP is just about abstract data typing, inheritance and polymorphism, but other issues can be at least as important. The remainder of this section will cover these issues.
类包含或者继承一个或多个纯虚函数,这样的类就是抽象基类。
A class containing (or inheriting) one or more pure virtual functions is an abstract base class.
类包含或者继承一个或多个纯虚函数,这样的类就是抽象基类。
A class containing (or inheriting) one or more pure virtual functions is an abstract base class.
应用推荐