>  2. doSelect creating subclass of the data object : As I ready expained in
>  some mails earlier ([Proposal] Change *Peer.doSelect() generation -
Torque)
>  . This is the resolution of the problem is that the Peer object knows the
>  data object. An example : an Address table/object. I have the MyAddress
>  extends Address (with more methods). The doSelect() method create a
vector
>  of Address. But I can't cast from Address to MyAddress. So I have to
modify
>  the doSelect method to generate a vector of MyAddress. What I propose is
to
>  modify the doSelect method. We transmit to this method the className to
>  generate. That meens :public static Vector doSelect(Criteria criteria,
>  String className).

I think I have a better solution:

DoSelect should not use "new Address()" in this case. Rather than that it
should define a method:

protected Address createObject()
{
  return new Address();
}

and in doSelect simply use "createObject()" instead of "new"

this way, if you simply want MyAddressPeer.doSelect to return a vector of
MyAddress all you need to do is to overload createObject():

protected Address createObject()
{
   return new MyAddress();
}


this should be completely transparent and backward-compatible.
Does it make sense?

fedor.





_______________________________________________________
Say Bye to Slow Internet!
http://www.home.com/xinbox/signup.html



------------------------------------------------------------
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