3 ms·
I believe the author was attempting to illustrate both how easy this is to do in Java, and how prevalent the practice is. Every book I've read on Java shows ev
by pixelbath 16y ago
I believe the author was attempting to illustrate both how easy this is to do in Java, and how prevalent the practice is.
Every book I've read on Java shows even the "Circle inherits from Shape" examples to be ridiculously overarchitected and encapsulated (I am aware of why they are this way for illustrative purposes, however).
- mmilkin 16y agoLets not get into the faults of Java and inheritance this thread might devolve into something it shouldn't :). But its a good idea to do some of this stuff where and WHEN its appropriate. You can design a space shuttle to go to the grocery store doesn't mean you should. I have seen my fare share of useless hard to understand and over engineered code in C, Groovy, Java and Lisp A good book about this by Joshua Kerievsky is Refactoring To Patterns he talks exactly about this, the dangers of using patterns and the dangers of not (yes he uses Java in his examples)