Rick Graves wrote:
Paul,

bizSite =
self.Application.biz.Site(self.Application.dbConnection)

which will create a new instance of the Site bizobj.
Save that instance somewhere you know where to find
it, and you can use the instance wherever you like.

If the table is updated, will the new instance of the
business object know about the update?  I assume an
advantage of having one and only one business object
for a table is that the business object knows about
all updates.

Yes, if you are only using one bizobj, and all your table updates go through that bizobj, then by definition the bizobj will know about it.

However, what if you wanted two sets of UI controls connected to the same bizobj, but when you change the row in one UI you don't want the row to change in the other UI set. The answer is to use separate instances of the bizobj, and then determine when to requery() each yourself.

Is there a way to add references to other business
objects to a form?
biz = self.Application.biz.AnotherBizobj
self.Form.addBizobj(biz)
bizDataSource = biz.DataSource
# to get a reference at some point in the future:
biz = self.Form.getBizobj(bizDataSource)

If I must have duplicate instances of the business
object for a table, the original plan of having
separate copies of the key/name list/tuple might be
better.  How would the copies get updated when the
table gets updated?

You can define afterRequery(), afterNew(), afterDelete(), afterChange() hook methods. These get automatically called from the bizobj as appropriate. Have each call your defined bizobj function for generating the list.

--
pkm ~ http://paulmcnett.com


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users

Reply via email to