Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 123603
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T04:18:45+00:00 2026-05-11T04:18:45+00:00

Fragile base class is one of the most common point that gets popped up

  • 0

Fragile base class is one of the most common point that gets popped up in every discussion where reusability through implementation inheritance is discussed.

Has anyone faced any real issue with these apart from the common square, rectangle examples.

Everytime I need to explain this to someone I am stuck with some real world cases where these problems aroused and how this was solved.

If anyone would like to share their experience regarding this it would be really helpful.

Here’s a wikipedia link to understand this problem

Fragile base class on wikipedia

EDIT:

My inputs with respect to this… The problem mostly happens when the base class version changes as the developers using this may not be aware of the extensions happening to the base class implementation and the base class implementor may not have all the necessary details about all the derived classes. And the seemingly innocuous change may break all the derived class functionality. And in any case this is a bad design practice as it will break the OCP principle.

Got a nice quote from Joel on Software old forum. Thought of putting it down.

‘Our inability to sometimes deal with the complexities of modern life is actually an example of the fragile base class problem occurring in nature, the reason being that we’re still inheriting many characteristics from our ancestors who led very different lives.’

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T04:18:46+00:00Added an answer on May 11, 2026 at 4:18 am

    Yes – java.util.Properties is a pain to derive from.

    For the moment let’s leave aside the fact that it derives from java.util.Hashtable to start with (which means it has get(Object) and put(Object, Object) despite the fact that properties are always strings…

    I once subclassed java.util.Properties to provide a sort of hierarchical structure – in a properties file I had:

    x.y.z = 10 a.b.c = 10 

    and you could ask the ‘master’ properties for ‘x’ (with a new method call) and it would give you another properties object which would effectively contain ‘y.z = 10’ etc. It was handy to subclass java.util.Properties as many other pieces of code already knew used properties. If it had implemented an interface, I wouldn’t have subclassed, and I wouldn’t have had any problems 🙁

    Anyway, I needed to override getProperty() to refer back to the parent properties if necessary. But there are two overloads – which should I override? Does getProperty(String) call getProperty(String,String) or vice versa? Maybe I only need to override get()? It’s not documented, and if I only overrode one of them, the implementation could change in a later version to switch things round – so I needed to override both of them.

    The same went for various other methods (saving and loading were a pain, IIRC – this was a long time ago). Basically I could have done the job more simply if I could have relied on bits of the implementation of Properties not changing – but that would obviously have made it harder for Sun to improve the implementation at a later date.

    Anyway, this was a definite example where composition and exposing an interface which clients would rely on would have been much better.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What is the fragile base class problem in java?
I have a a Java class that gets a form definition from database then
I have a dependency that gets called when the object I'm testing is created.
I often have to work with fragile legacy websites that break in unexpected ways
Possible Duplicate: name hiding and fragile base problem I'm familiar with the rules involving
Imagine you have a derived class, where the base class is something you cannot
I have a project that has some files that are fragile in a sense
I will choose Java as an example, most people know it, though every other
I am finding the CSV parsing in Ruby 1.9.3 to be remarkably fragile. So
I need to plot a function on a coordinate system that has its origin

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.