ArrayIndexOutOfBoundsException
...
extends IndexOutOfBoundsException
extends RuntimeException
extends Exception
extends Throwable
Not exactly an abomination, but I would not call it thing of beauty ArrayIndexOutOfBoundsException
...
extends IndexOutOfBoundsException
extends RuntimeException
extends Exception
extends Throwable
Not exactly an abomination, but I would not call it thing of beautyI think this is an example of an hierarchy without a purpose.
Pointless OO, what's not to love here..
Up to you man. Peace.
One way of viewing nouns in English is as a hierarchy. At the top of the hierarchy you have "thing", and as you descend the pyramid you get more and more specific. "What is that thing?" -> "What is that animal?" -> "What is that mammal?" -> "What is that ungulate?", etc.
There are times when it is appropriate to use "animal", and times when it is appropriate to use "ungulate". It depends on context. OO allows you to have the same levels of abstraction, and it can be a powerful tool.
NOW, having said that, there are two problems with this:
1) Not everything is a noun. Sometimes you want to deal with verbs.
2) Realistically, these hierarchies (in Java) tend to become overly-complicated over time. That's what OP is talking about.
There are cases, though, like the aforementioned Throwable, where having a deeply (more than 3 layers deep) nested hierarchy is wholly appropriate.
When dealing with OOP, I stick with patterns and keep everything else as flat as possible.
Yes, yes it is. All natural languages are. They are living, breathing, evolving, organic concepts. They don't have the benefit of being designed and prescribed by an individual or group of individuals like programming languages do.