CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7

Threaded View

  1. #3
    Join Date
    May 2009
    Posts
    2,413

    Re: Best Object Oriented approach for building model objects?

    Quote Originally Posted by keang View Post
    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
  •  





Click Here to Expand Forum to Full Width

Featured