Solved

Dynamic Inheritance

Posted on 1998-04-27
3
533 Views
Last Modified: 2008-03-03
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
Comment
Question by:sreejesh
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 11

Accepted Solution

by:
alexo earned 10 total points
ID: 1164272
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
 
LVL 5

Expert Comment

by:yonat
ID: 1164273
0
 

Author Comment

by:sreejesh
ID: 1164274
Thank You Yonat.Now I got the concept of Dynamic Inheritance throug the given site.Thank You very much.
0

Featured Post

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

615 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question