[EMAIL PROTECTED] wrote:
> > In your business object you could do something like this:
> >
> > //In the Catalog Business Object
> >
> > public Vector getProducts()
> > {
> >
> >    Peer p = PeerService.getPeerOf("PRODUCTS");
> >
> >    Criteria c = new Criteria();
> >    c.add(p.getColumn("brand"), "ACME");
> >
> >    return = p.doSelect(criteria);
> > }
> 
> Ok, so this would be:
> 
> public class Catalog{}
> 
> right?
> 

Right.

> So, I suggest the following...
> 
> public interface Peer
>         // defines a Peer
> public abstract class BasePeer implements Peer
>         // doSelect(), etc...
> public class TableMapPeer extends BasePeer
>         // setTableMap()
> public class PeerFactory
>         // generates Peer's from TableMapPeer


I was thinking the TableMap can stay pretty much as it is. And that a Peer 
and TableMap should have a composition type relationship (vs. inheritance).

public class Peer
{
    private TableMap tm = null;
 
    public Peer(TableMap tm)
    {
       this.tm=tm;
    } 
} 

So in the PeerFactory you'd do something like this:

public class PeerFactory
{
   public static Peer getPeer(TableMap tm)
   {
        return new Peer(tm);
   }
}


> public class PeerService
>         // uses PeerFactory to generate Peer's


-- 
Dave
[EMAIL PROTECTED]
your flame > /dev/null


------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]

Reply via email to