Fragile Base Class
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 in isolation the methods of the base class.
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 themselves.
Another alternative solution could be to have an interface instead of superclass.
Read more about Fragile Base Class: Solutions
Famous quotes containing the words fragile, base and/or class:
“If today there is a proper American sphere of influence it is this fragile sphere called earth upon which all men live and share a common fatea sphere where our influence must be for peace and justice.”
—Hubert H. Humphrey (19111978)
“The highest perfection of politeness is only a beautiful edifice, built, from the base to the dome, of ungraceful and gilded forms of charitable and unselfish lying.”
—Mark Twain [Samuel Langhorne Clemens] (18351910)
“The Americans never use the word peasant, because they have no idea of the class which that term denotes; the ignorance of more remote ages, the simplicity of rural life, and the rusticity of the villager have not been preserved among them; and they are alike unacquainted with the virtues, the vices, the coarse habits, and the simple graces of an early stage of civilization.”
—Alexis de Tocqueville (18051859)