in reply to Re: When are packages the right design choice?
in thread When are packages the right design choice?
My biggest gripe with most OO tutorials/books/whatever is that the example is usually something trivial that fits into an OO model neatly, such as types of animals or geometric shapes. In the real world, you're likely to encounter data that is not so clear.
I agree. I worked hard to avoid using "a square ISA rectangle" type examples in my book. My primary OO example class is a logger called BOA::Logger for the fictitious Big Ol' Application. Instead of talking about inheritence as a way to express "natural" relationships, I tried to present it the way it's really used - as an extension mechanism to enhance an existing class. I also tried to give equal time to composition, an alternative to inheritence which often results in simpler code with equal or greater flexibility.
-sam
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: When are packages the right design choice?
by Abigail-II (Bishop) on Jun 04, 2004 at 08:09 UTC | |
by bl0rf (Pilgrim) on Jun 04, 2004 at 16:51 UTC | |
by kragen (Sexton) on Jun 05, 2004 at 00:11 UTC | |
by hardburn (Abbot) on Jun 07, 2004 at 16:58 UTC |