|
-
October 11th, 2009, 12:42 PM
#1
Object Oreinted inheritance design question
Hello,
I have two OOP design questions:
1. I have four classes say A, B, C, and D. B is derived from A. Class C is derived from B, but it is an optional class in my toolkit. Class D is also optional, but it needs to be derived from class C if it is used, otherwise it should be derived from class B.
One way to solve this I guess if use preprocessor definitions, and have #ifdef's in the code. But, is there any other good design way to handle this?
2. Say I have 3 classes, A, B, and C. I want C to either be derived from class A or class B. I know I can use multiple inheritance to derive C from both A and B, but I want to be abelt o make this decision dynamically when an instance of class C is created. Is that possible with C++?
Regards,
Ellay K.
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
|