Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Dynamic Inheritance

Posted on 1998-04-27
3
Medium Priority
?
538 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 20 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

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!

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…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
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…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
Suggested Courses

715 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