Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 544
  • Last Modified:

Dynamic Inheritance

Can you please tell me clearly the concept called " Dynamic inheritance".
My understanding is, Dynamic inheritance allows objects to change and evolve over time. I read like this :  Dynamic inheritance refers to the ability to add, delete,or change parents from objects (or classes) at run-time.Is it only means that we can change the properties of a Base class through the derived class at the run time?.
Expecting more explanations about this concept from all of you Experts !.
0
sreejesh
Asked:
sreejesh
1 Solution
 
alexoCommented:
Your first statement was correct.  Dynamic inheritance means changing parents.
C++ does not support dynamic inheritance as-is, however it can be faked.

Here's a quote from the Object-Orientation FAQ:

1.10) What Is Dynamic Inheritance?

Dynamic inheritance allows objects to change and evolve over time.  Since base classes provide properties and attributes for objects, changing base classes changes the properties and attributes of a class.  A previous example was a window changing into an icon and then back again, which involves changing a base class between a window and icon class.

More specifically, dynamic inheritance refers to the ability to add, delete, or change parents from objects (or classes) at run-time.  Actors, CLOS, and Smalltalk provide dynamic inheritance in some form or other.  Single hierarchy systems, such as Self, provide dynamic inheritance in the form of delegation [Ungar 87].

4.4) Can I Use Dynamic Inheritance In C++?

Yes, [Coplien 92] describes a scheme where a class can contain a pointer to a base class that can switch between its derived classes, providing a limited form.  Earlier chapters contain entries on bypassing C++'s message system and even bypassing static linking.

[Coplien 92] James O. Coplien.  Advanced C++ Programming Styles and Idioms.  Addison Wesley.
Covers advanced C++ programming and performing other more advanced and dynamic styles of OO in C++.


0
 
yonatCommented:
0
 
sreejeshAuthor Commented:
Thank You Yonat.Now I got the concept of Dynamic Inheritance throug the given site.Thank You very much.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now