On Tuesday, June 28, 2011 02:43:00 pm Paul McNett wrote: > On 6/28/11 2:33 PM, John Fabiani wrote: > > By global I mean that the connect instance is available everywhere from > > anywhere. The way you are using it. Where as if the connection was > > created in createBizobj it is only used in the MainForm method. > > True, the application object is available from anywhere, which makes it a > good place to store the connection instance. > > > Of course self.Application is still available to retrieve the connection. > > > > I like the flexibility of the first method where I can create generic > > bizobj's classes and use them differently by attaching children as > > required by each form. IOW's one form might require a different set of > > children from another form. The relationships between a parent and > > different children may not be static or not required for form. > > Should it be the form that describes the bizobj parent:child relationship? > I have different needs in different contexts, too, so I have different > subclasses of my bizobjs defined in the biz layer. > > > In Nate's case, it appears to be a straight forward parent child. In my > > case an enrollment has different relationships. I guess I could setup a > > permanent relationship but of course then I'd have the over head of the > > opening tables not needed. > > Yes, there are cases where you don't want all the baggage of moving to the > next order to requery the children, the childrens' children, etc. But you > can achieve that and still keep the biz relationship code out of the UI... > > Paul >
It sounds like we are splitting hairs. You still create the instance of the bizobj which in turn sets up the relationships. But I do see the merit of moving the setup of the relationships (the description into the bizobj) away from the UI code. Yet I still have a negative response to creating globals in general. So I see the advantage but I also see the negative. I'm old school and think of getters and setters rather than globals. However, in today's thinking most programmers feel it's OK to break the rule. Johnf _______________________________________________ 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]
