> 
> 
> >>If I have object A which has an ArrayList of B objects each of which may
> >>have a collection of C objects, and I commit object A to the database, any
> >>changes made to the B and C objects are automagically reflected to the
> >>database. Modified B and C cause updates, new B and C cause inserts. 
> >>
> >>Have I made it clearer?
> 
> >The problem is that conceptually, this isn't how Peer's work.
> 
> So if we use Peers, we're on our own for managing the hierarchy?
> 
> Chris

I think that you should spend some time exploring Peers as conceptually the
hierarchy doesn't exist as far as I understand from what you are describing.
In other words, each object has a Peer associated with it. You use the Peer as
your means of telling the object what it should do.

For example:

Member.java (object)
MemberPeer.java (peer)

Member mem = new Member();
mem.setFirstName("jon");
mem.setLastName("stevens");
MemberPeer.doInsert(mem);

If you have to update multiple tables in order to add a new member, then so
far, what I do is i make a "MemberManager" object that is responsible for
wrapping the business logic of adding a member.

Here is some more pseudo code...

public class MemberManager
{
    public static void newMember(firstname, lastname)
    {
        Member mem = new Member();
        mem.setFirstName(firstname);
        mem.setLastName(lastname);
        MemberPeer.doInsert(mem);

        Access acc = new Access();
        acc.setUser(firstname);
        acc.setRole ("admin");
        AccessPeer.doInsert(acc);
    }
}

As you can see, it combines the businsse logic into a "Manager" object. This
is something that we of course cannot really generate for you.

So, I'm not quite clear on how you are going to chain the objects together or 
have the Peer model conceptually do it for you. I'm open for education here
though so feel free to explain to me how you would like to see it implemented.

thanks,

-jon


-- 
Scarab -
      Java Servlet Based - Open Source 
         Bug/Issue Tracking System
        <http://scarab.tigris.org/>


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