Hi,

> 
> 
> - I need a contructor that create a new 'ExtendClass' object based on a
> 'OmClass'
> 
> // Pseudo code
> public ExtendClass(OmClass omObject) {
> 'clone' omObject in to super.Fields[]; // <<<<<==== what I would like
> to do
> ....
> .... (instantiate the rest of aggragations)
> }
> 
> where can i find a 'clone' that do the job? 
> Does java.lang.Oject.Clone do the job as I except?
> 

The java.lang.Object.clone() will give you another OmClass object - which is not what 
you want.  You want to use the innards of clone() to set your instance variables.

Can you add a constructor like OmClass (OmClass omObject) to OmClass - get that to do 
the field/etc copies - but clone will still not be good for this - maybe Torque could 
do it for you...

Then in your extended class do something like 

ExtendClass(OmClass omObject) {
super(omObject);
....
}

This puts the responsibility with the objects that know about the fields.


Alternatively - does ExtendClass have to actually extend OmClass - perhaps it could 
have an internal reference to the OmClass object - in which case the clone method 
would be fine for you.

Hope this helps,
Chris
---
"surely it is madness to accept life as it is and not as it could be"
______________________________________________
FREE Personalized Email at Mail.com
Sign up at http://www.mail.com/?sr=signup



------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]

Reply via email to