|
The fragile base class problem is a fundamental architectural problem of object-oriented programming systems where base classes (superclasses) are considered "fragile" because seemingly safe modifications to a base class, when inherited by the derived classes, may cause the derived classes to malfunction. The programmer cannot determine whether a base class change is safe simply by examining the base class's methods in isolation. Object-oriented programming (OOP) is a programming paradigm that uses objects to design applications and computer programs. ...
In computer science, a superclass is a class from which other classes are derived. ...
In object-oriented programming, a subclass is a class that inherits some properties from its superclass. ...
Sometimes the fragile binary interface problem is referred to as the fragile base class problem. The two problems are related but very different. The fragile binary interface problem is a shortcoming of certain object-oriented language compilers, in which internal changes to an underlying class library can cause descendant libraries or programs to cease working. ...
One possible solution is to make instance variables private to their defining class and force subclasses to use accessors to modify superclass states. A language could also make it so that subclasses can control which inherited methods are exposed publicly. These changes prevent subclasses from relying on implementation details of superclasses and allow subclasses to expose only those superclass methods that are applicable to itself. Also, in general, programmers should program to interfaces rather than concrete implementations.
Solutions Objective-C, often referred to as ObjC or more seldomly as Objective C or Obj-C, is an object oriented programming language implemented as an extension to C. It is used primarily on Mac OS X and GNUstep, two environments based on the OpenStep standard, and is the primary language...
Objective-C, often referred to as ObjC or more seldomly as Objective C or Obj-C, is an object oriented programming language implemented as an extension to C. It is used primarily on Mac OS X and GNUstep, two environments based on the OpenStep standard, and is the primary language...
Ruby is a reflective, object-oriented programming language. ...
In object-oriented programming languages, a mixin is an approach to implementing classes that differs from the most widely-used approach coming from the programming language Simula. ...
Component Pascal is a programming language in the tradition of Oberon and Oberon-2, the last language Niklaus Wirth designed before he retired in 1999. ...
See also Software brittleness is the ironic term that describes the increasing difficulty of fixing older software. ...
In C++, virtual inheritance is a kind of inheritance that solves some of the problems caused by multiple inheritance (particularly the diamond problem) by clarifying ambiguity over which ancestor class members to use. ...
External links |