Hi,
----- Original Message -----
From: Eric J Altman <[EMAIL PROTECTED]>
> Hello,
>
> In a case like the following (simplified):
>
> CREATE TABLE
> TRANSACTION_ID INTEGER NOT NULL,
> CUSTOMER_ID INTEGER NOT NULL,
> PRIMARY KEY (TRANSACTION_ID),
> FOREIGN KEY (CUSTOMER_ID)
> REFERENCES CUSTOMER(CUSTOMER_ID)
> )
> ;
> CREATE TABLE
> CUSTOMER_ID INTEGER NOT NULL,
> CUSTOMER_DESCRIPTION VARCHAR(255),
> PRIMARY KEY (CUSTOMER_ID)
> )
> ;
> (excuse the pseudo-mysql, that's the basic idea anyway...)
>
> I'd like to do a select in the generated CustomerTransactionPeer and get
> back a vector of CustomerTransactionMaster (name??) objects that just
> wrap the other two objects. NGMBT would generate a class like this:
>
> CustomerTransactionMaster
> ---------------------
> getTransactionId()
> getCustomerId()
> getCustomerDescription()
>
> etc...
>
> Some questions:
>
> Is this out of scope to your proposal for more functionality in NGMBT?
>
In your case the new NGMBT would add a getTransactions() method to the
Customer dataobject that returns a vector of Transaction dataobjects
corresponding to that particular customer. The getTransactions() method
will call TransactionPeer with a criteria object containing the CustomerID.
Essentially the new methods will only be utility methods in the dataobjects
that wraps around existing peer functionality - The peer classes will stay
exactly the same. If I understand you right this is not exactly what you
had in mind.
> As I recall, something like the following was discussed at the
> turbine/scarab confab:
>
> BusinessLogic (hand coded class)
> DataObject (generated from schema, 1 class:1 table)
> Peer (generated from schema, 1 class: 1 table)
>
> Is it worthwhile or just redundant to throw an optional DataObjectMaster
> in between DataObjects and a BusinessLogic object? Is a
> DataObjectMasterPeer needed to lazily fill in the objects related by
> foreign keys? What's a good design for using the peer model that
> insulates business logic from future (de)normalization of an underlying
> sql structure more than having a 1:1 class to table design?
Just a thought - I haven't worked on Peer long enough to give you a
meaningful answer - I can see how this might be useful, but isn't this going
a bit beyond the design of Peer and more towards something like Castor?
> Regards,
> ~Eric
>
>
> ------------------------------------------------------------
> To subscribe: [EMAIL PROTECTED]
> To unsubscribe: [EMAIL PROTECTED]
> Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
> Problems?: [EMAIL PROTECTED]
>
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]