This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Java in General and the fly likes Java Bean Inheritance Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Java Bean Inheritance" Watch "Java Bean Inheritance" New topic
Author

Java Bean Inheritance

Rob Qas
Ranch Hand

Joined: Apr 10, 2006
Posts: 34
dear all,
i have a situation that i have beans that share some data i did a super class wiche contain these data but i think its not the right way i thought of composition then of sending the general class to the constructor and setting the general data can any body please help me in the best practice in this situation
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Why do you think that inheritance is not the right way to do it?


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Rob Qas
Ranch Hand

Joined: Apr 10, 2006
Posts: 34
cose i think it loose the generalization in inheritance
 
Don't get me started about those stupid light bulbs.
 
subject: Java Bean Inheritance
 
Similar Threads
How to do this?
4 fields that makes one set
Servlet container - duplicate class definition
Getting reference to active threads
Accessing a session scoped variable anywhere outside the session scoped context