[PEAK] using peak model & storage in a GUI

Dave Peticolas dave at krondo.com
Wed Apr 6 21:44:23 EDT 2005


Hi, I have a few questions about using PEAK.model and PEAK.storage in
a rich GUI client. Are there any examples of using PEAK with a GUI out
there?

It seems that you might use the PEAK models you create for an
application's data model as the basis for the GUI models of a
Model-View-Controller design. When a model is loaded with a data
manager, though, it will lose all of its state after the transaction
is closed. It seems resetStatesAfterTxn controls this, but I wonder if
there is a good reason not to set it to False?

Also, you cannot change the models outside of a transaction and I'd
like to avoid leaving a transaction open during a potentially long
editing session.

Is there an easy way to 'unhook' a model from a data manager?
Is this a reasonable way to use PEAK models in a GUI?

I'd also like to get event notifications when a model is changed.
Would it be appropriate to make a model an IEventSource and then
wrap the get/set/unset methods of a model's attributes to generate
change events? Is there an easy way to adjust attribute behavior
model-wide without using a new metaclass?

thanks,
dave





More information about the PEAK mailing list