|
-
January 15th, 2012, 11:40 AM
#6
Re: Class Design
 Originally Posted by NLscotty
Code:
class Dialog : public WinFunc
class WinFunc : public WinIcon
class WinIcon : public WinBGround
Class WinBGround : oublic WinTrats
As D_Drmmr mentioned, it looks like you're deriving classes from other classes only to save typing. That is not the way to use public inheritance.
The class hierarchy using public inheritance is supposed to model an IS-A relationship. A Windows function is not a Windows Icon, A Windows Icon is not a background, etc., so you should not be setting up your classes this way. In other words, the inheritance must make "real-world" sense.
Regards,
Paul McKenzie
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
|