|
-
May 12th, 2012, 06:24 AM
#3
Re: Best Object Oriented approach for building model objects?
 Originally Posted by keang
There is also a third OO way, ie by creating a class hierarchy whereby City extends District, which extends State, which extends Country.
I wouldn't recommend inheritance be used like that because these are natural part-whole composition relationships. For example a State is not a Country - a State is part of a Country.
One OO design pattern in special targets such relationships and that's Composite.
Last edited by nuzzle; May 12th, 2012 at 06:55 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|