Explore chapters and articles related to this topic
C++ and Objective C
Published in Paul W. Ross, The Handbook of Software for Engineers and Scientists, 2018
One of the most distinguishing means of representing relationships between abstractions in an OO program is with inheritance. Inheritance means forming subclass/superclass relationships between classes, also known as a base class and derived class relationship. A subclass inherits members from its superclass. Many classes together form an inheritance, or a class, hierarchy. Classes at the top of a hierarchy represent the data and functionality common between the classes that inherit from them. Classes at the top tend to be more abstract; objects are usually not instantiated from such classes. Classes at the bottom of the hierarchy are more concrete, and are more likely to be instantiated into objects. Classes that inherit from only one superclass exhibit single inheritance. Classes that inherit from more than one superclass exhibit multiple inheritance. Rich language that it is, C++ supports both single and multiple inheritance.
Introduction to Expert Systems
Published in Chris Nikolopoulos, Expert Systems, 1997
In this section, we show how an Object-Oriented programming environment can be built in Prolog. Schema design constraints were added to check for consistent and non-redundant object oriented schema design. An Object Oriented schema is a directed acyclic graph, (DAG). The nodes of the DAG correspond to classes and objects, and the links form an ISA hierarchy. A subclass inherits instance variables and methods from its parent class. Messages are externally sent to an object in the schema and are processed using the inheritance links. Multiple inheritance is encountered when a class is a subclass of many superclasses and inherits properties from them. In this case, we can have the potential for conflicts over which methods should be used or which default value should be inherited. In the implementation given below, the user can resolve multiple inheritance issues, by using depth first search of the DAG (see Chapter 3).
Agents, Objects, and Frames
Published in Adrian A. Hopgood, Intelligent Systems for Engineers and Scientists, 2021
While multiple inheritance is useful, it can cause ambiguities. An example is shown in Figure 4.16, where Defect inherits the graphic feature.gif from Feature and at the same time inherits the graphic transmitter.gif from Transmitter. This situation raises two questions. Do the two attributes with the same name refer to the same attribute? If so, the class Defect can have only one value corresponding to the attribute graphic, so which value should be selected? Similarly, Defect inherits conflicting definitions for the operation send_pulse.
Multi-model probabilistic analysis of the lifecycle cost of buildings
Published in Sustainable and Resilient Infrastructure, 2022
Stevan Gavrilovic, Terje Haukaas
Figure 1 shows a class map with selected components in Rts. Each box in the figure represents a class, with the class name shown in boldface. Below the boldface class names are the ‘member functions,’ e.g., getYieldStrength(), which show the information that the components provide. The classes in the boxes that are lower in the figure, such as walls and columns, ‘inherit’ or gain access to the information from the classes above. The classes in the boxes at the bottom of the figure are created as objects, e.g., the Steel Column Component. Multiple inheritance allows a component to inherit information and functionality from several classes. For example, information common to all reinforced concrete components is implemented once in the RC Component class and is available later in any class that inherits from it. Further details about the creation of components from BIM are presented in the forthcoming PhD dissertation of the first author (Gavrilovic, 2020). In addition to the information contained in the components, certain building-level information, such as number of storeys, location, and occupancy, is imported into a class in Rts called RBIM, described in the next section.