
繼承層次;繼承體系;繼承階層架構
The root class of an inheritance hierarchy should define a virtual destructor even if the destructor has no work to do.
繼承層次關系的根類應該定義虛函數性質的析構函數,即使這個析構函數不做任何的事情。
A global aspect utilizing a signature pattern based on packages and the inheritance hierarchy would serve you better in this situation.
在這種情況下,利用基于包和繼承層次結構的簽名模式的全局方面可以做得更好。
That's because objects in the real world just don't fit into a ****** single inheritance hierarchy.
那是因為實際世界中的對象不會剛好適合一個簡單的單繼承層次結構。
At the top of Listing 4, you see a nested module definition. A module has method definitions, but no base inheritance hierarchy.
在 清單 4 的頂部,可以看到一個嵌套的模塊定義,但是沒有基繼承層次結構。
If you would like to rename this method, a check of all classes in the inheritance hierarchy is needed to find all positions in the code which should be changed.
如果你要重命名這個方法,必須檢查繼承層次中的所有類,以找到應該做出改變的所有位置。
Instead, we'd either have to copy code along multiple paths in the inheritance hierarchy or employ the Strategy pattern (or some other trick using containment) to avoid copying code.
另一種方法是,我們要麼必須沿着繼承層次結構中的多條路徑複制代碼,要麼使用策略模式(或其它使用限制的一些訣竅)來避免複制代碼。
An inheritance hierarchy is a way of organizing a set of abstractions from most general to least general.
繼承的層次是從最多到最少的概要(共性)中構建一組抽象的方法。
If you have an inheritance hierarchy that is too broad, inheritance will break down.
如果已有的繼承等級非常寬,繼承就會失效。
The assertion fails if there exists one element in the collection for which the specified type is not found in its inheritance hierarchy.
判斷提示失敗,如果那裡存在的集合中之指定的型别中找不到其繼承階層架構中的一個項目。
Finalization must be propagated through the inheritance hierarchy.
終止必須通過繼承層次結構傳播。
Gets the name of the management class in which the method was first introduced in the class inheritance hierarchy.
獲取管理類的名稱,在該類中第一次将該方法引入到類的繼承層次結構。
The assertion fails if the type is found in the inheritance hierarchy of the object.
如果此型别位于物件的繼承階層架構内,判斷提示就會失敗。
Classes in the same inheritance hierarchy typically belong in the same package.
一般位于同一繼承層次上的類也屬于同一個包。
The Template Method pattern suggests that I should move common boilerplate code up the inheritance hierarchy, deferring algorithmic details to child classes.
TemplateMethod模式建議,應當将公共模闆代碼移到繼承層次結構之上,将算法細節推遲到子類。
Knowledge base is based on Common Information Model (CIM): reasoning rules in Knowledge base have inheritance hierarchy, just as device classes in CIM do;
知識庫充分結合國際标準的CIM模型,依照CIM模型中的設備繼承層次結構,建立推理規則的層次結構;
The standard MBeans convention would make the interfaces depend on the implementations and represents a needless duplication of the inheritance hierarchy for this system.
标準MBean 的約定使得接口依賴于實現,而且代表這個系統的繼承層次出現不必要的重複。
A class's members include all the members declared in the class, along with all members (except constructors and destructors) declared in all classes in its inheritance hierarchy.
類的成員包括在類中聲明的所有成員,以及在該類的繼承層次結構中的所有類中聲明的所有成員(構造函數和析構函數除外)。
Conceptually, we can think of the inheritance hierarchy as defining a search technique for methods and variables.
理論上,我們認為繼承階層是作為定義方法和可變物質的一個查尋技術。
To understand why, we need to look a little closer as to what exactly is necessary to support adding methods and fields (and even more advanced, changing the inheritance hierarchy).
為了理解這其中的原因,我們需要稍微靠近一點看一看,到底是需要用什麼來支持方法和域的添加操作(甚至更深入一些,修改繼承的層次結構)。
We need two new Classes at either end of the inheritance hierarchy to do this.
在繼承層次的每個端點,我們需要兩個新類來完成這個。
Traditional object-oriented programming, especially in languages like Python that allow multiple inheritance, attempt to modularize concerns with an inheritance hierarchy.
傳統的面向對象編程,尤其是在諸如Python之類允許多重繼承的語言中,都會試圖使用一個繼承層次結構來模塊化關注事項。
Listing 4 shows how you might use the declare parents tag to change Foo's inheritance hierarchy.
清單4顯示了用declareparents标籤來改變Foo的繼承層次。
However, this would make test case classes difficult to reuse between test types, because the test type decision is made near the root of the inheritance hierarchy;
但是,這會使測試環境類在測試類型中難以再利用,因為測試類型的決定是在靠近繼承層次的根部作出的;
Just look at the Java class hierarchy to see an elaborate set of object inheritance hierarchy.
僅僅查看Java類就可以看到一組精巧的對象繼承層次結構。
In other words, a complete inheritance hierarchy is stored in a single database table.
換言之,整個繼承層次結構存儲在單個數據庫表中。
A constructor for the base class is always called during the construction process for a derived class, chaining up the inheritance hierarchy so that a constructor for every base class is called.
一個基類的構造方法在它的派生類的對象創建過程中是會被調用的,根據繼承關系圖一層層追溯,所有基類的構造方法都會被調用的。
在面向對象編程(OOP)中,inheritance hierarchy(繼承層次結構) 指通過類與類之間的繼承關系形成的樹狀結構。這種結構以基類(父類)為起點,逐層派生出更具體的子類,體現代碼複用和邏輯分層的特點。
繼承(Inheritance)
繼承允許子類複用父類的屬性和方法,同時可擴展或重寫功能。例如,在Java中,若父類Animal
定義了eat
方法,子類Dog
可直接繼承該方法,或通過重寫實現特定行為。
層次結構(Hierarchy)
層次結構表現為類的縱向分層。例如,父類Vehicle
可派生子類Car
和Bicycle
,而Car
又可進一步派生出ElectricCar
和GasolineCar
,形成多層關系。微軟的C#文檔指出,這種結構能清晰反映現實世界的分類邏輯。
在編程中,繼承層次結構常用于建模領域知識。例如,圖形界面庫可能包含基類UIComponent
,子類Button
和TextField
繼承其基礎屬性,而Button
又可細分為Checkbox
和RadioButton
。GeeksforGeeks的技術文章通過代碼示例展示了這種分層設計如何提升代碼可維護性。
"inheritance hierarchy"(繼承層次結構)是面向對象編程(OOP)中的核心概念,指通過繼承關系形成的類與類之間的樹狀結構。以下是詳細解釋:
定義與結構
核心作用
常見類型
設計原則
相關概念
繼承層次結構廣泛應用于框架設計(如Java集合框架、GUI組件庫)和業務建模(如電商系統的訂單體系)。合理設計層次結構能提升代碼可維護性,但需注意避免"脆弱基類"等問題。
by any chancecall in questionbroachdespicablestrictureancillariesbespreadBleulercarousingdenominatingsucksswansonabreast ofattend schoolheat dissipationhiding powerin churchMadame Curieremoval efficiencytransparent colorarciformascaroideabiographicallybrassagecasehardenCGTesculinlactorrhealiverymanplat