wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Dynamic Inheritance Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Dynamic Inheritance" Watch "Dynamic Inheritance" New topic
Author

Dynamic Inheritance

Niyas Ahmed Sheikh
Ranch Hand

Joined: Jun 15, 2005
Posts: 129
Hi,

What is Dynamic Inheritance. What are the Pros and cons of using it?
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Some less strongly typed languages let you change the parent class of an an object at runtime. I was just reading about this yesterday in ECMAScript aka JScript where you can change the template (parent class) on the fly.

THIS ARTICLE claims to do dynamic inheritance in Java but it's just using a Factory Method and not changing anything about a given object instance.

We can get more dynamic behavior through delegation and swapping strategies at runtime, but it's still not really changing the parent class.


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
 
 
subject: Dynamic Inheritance
 
Similar Threads
Reg multiple and dynamic classification in UML
Interfaces
Multiple inheritance in java...can b done?
Disadvantage for the Inheritance
Hybrid Inheritance