Sun, May 17, 2009 at 3:08 AM, Ed Leafe <e...@leafe.com> wrote:

> On May 16, 2009, at 9:04 PM, Miguel Lopes wrote:
>
> > self.bizobjDispatcher.getBizobjByRegID('account')
>
>        I'm curious about this method, as bizobjs do not have RegIDs. Is
> this
> something that you added? Is there a reason why you didn't rely on the
> form's getBizobj() method?
>
>
> -- Ed Leafe
>

Yes, I added it.
I didn't really mention it because I'm learning the framework. But here is
what I see (please keep in mind I haven't grokked Dabo).

Dabo's forms are very table centric, which makes it very convenient, but
this has its downsides. "Fortunately" it is possible to change the
primaryBizobj reference at will, so some difficulties go away. But if you
have different bizobjs from the same table, then there is the problem of the
Bizobj.DataSource being shared among several bizobj which seems not to be a
good thing (I read something about this in the list).

In my opinion the Bizobj.DataSource property should not reflect the table
name, because all bizobjs have a from clause added to the sql builder (or
UserSQL defined), but I'm probably wrong since I don't know the framework...

Anyway, all this discourages me to add more than one Bizobj with the same
DataSource to one form. So I came up with the idea to use a dispatcher. I
assign the dispatcher to the Form and add all bizobj to it using a unique
key for each (thus the "getBizobjByRegID", the dispatcher itself is the
simplest class with a dict attribute).

Now, to change the primaryBizobj it's as simple as asking the dispatcher. I
do this everywhere, including in setting controls dataSource attribute - I
very happy to find out that this has no side effects :-)

Did I make sense?

BTW: Does Bizobj.addChild work for bizobjs that have not been added to a
Form?

Miguel


--- StripMime Report -- processed MIME parts ---
multipart/alternative
  text/plain (text body -- kept)
  text/html
---
_______________________________________________
Post Messages to: Dabo-users@leafe.com
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/a19730800905161948j278828d9k3607c4516905c...@mail.gmail.com

Reply via email to