On Jun 28, 2011, at 5:14 PM, Paul McNett wrote:

> The only difference being that the form creates the parent bizobj, but the 
> children 
> are created by instantiating the parent bizobj. So instead of:
> 
> class MyForm(dForm):
>   def createBizobjs(self):
>     parent = self.addBizobj(BizParent(connection))
>     child1 = parent.addChild(BizChild1(connection))
>     child2 = parent.addChild(BizChild2(connection))
>     grandchild_of_child1 = child1.addChild(...)
>     ...
> 
> You define the children in the bizobjs themselves, so that whenever you 
> instantiate a 
> given bizobj you already have the child relationships in place. The form just 
> knows 
> about whatever "parent" bizobj to instantiate so the above becomes:
> 
> class MyForm(dForm):
>   def createBizobjs(self):
>     self.addBizobj(BizParent(connection))
> 
> The end result is of course the same, you just encapsulate the code better 
> IMO.

        Not quite the same, is it? Won't UI code that relies on 
dForm.getBizobj() no longer work for any bizobj but the parent?


-- Ed Leafe



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to