Hervé Guidetti wrote:
> >I use JDBCOMGenerator. Fine. I will use Torque soon. . I want to extend my
> >data object to add functionnalities to the data object without modifing it.
> >(It allow me to re-generate the Om Layer without having to rewrite my
> code).

Sure, this is a problem with generated data objects.

> >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
> >enerate a vector of MyAddress.

I'm wondering how other Turbiners deal with it right now.
I edited my generated classes by hand adding the additional functionality.
I changed Peer classes also, to deal with object relationships (my BO is
compound and thus represented by multiple tables. I wanted it to retrieve
all data with single call to MasterObjectPeer.doSelect() and delete all data
with single call to MasterObjectPeer.doDelete()).
I had to edit the code by hand anyway because Torque smashed the case or my 
table/colum names :-(.

Leon Messerschmidt wrote:

> I would not like to take away the normal doSelect (Criteria) method for two
> reasons.  The first is that you would break some code if the newly generated
> classes does not have that method and second you'll need to type the
> class-name every time you call doSelect.

Yup. -1 to breaking existing code.

> 
> I can see the usefulness of this approach so I think we should overload the
> doSelect() method in the Peer class that so that it can optionally take the
> class-name as a parameter.  On top of that I think we should add a static
> final string to the Peer class that defines the default class-name that will
> be instantiated if you do not supply a class-name with your doSelect.

This makes sense. +1


Rafal


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