There is another twist on the MVP pattern… Trellis!
Even if it is a little bit young… this piece of software is great…
I’ve started using it for a piece of my main software and I felt in love with it…
Now I’m looking at more ways to integrate it because it makes event management simpler, way simpler.
Documentation for the old version:
http://peak.telecommunity.com/DevCenter/Trellis
New new version (the one from SVN trunk) has some things changed… but the previous documentation should provide a clear enough look at what the library tries to achieve…
An overview of what changed:
http://www.eby-sarna.com/pipermail/peak/2007-November/002812.html
My intuition says that this is going to be used… a lot…
Peter.
···
On Dec 6, 2007 3:46 PM, Mark Erbaugh mark@microenh.com wrote:
On Thu, 2007-12-06 at 11:09 +0000, jonhattan wrote:
I’ve a design based on MVP, Model-View-Presenter --there’s some about
mvp in the wiki.
Jonhatten,
Thank you for your explanation. I had discovered the MVP write up in the
wiki and I am working through it. I noticed that Martin Fowler has
depricated the MVP pattern:
http://martinfowler.com/eaaDev/ModelViewPresenter.htmland replaced it with Supervising Controller and Passive View patterns.
I haven’t had time to study this yet.I think I have essentially implemented the functionality of your
interactor. Currently, it resides as a method in my view (wx.Frame)
class, but I have been thinking of separating it from there. Basically,
the wx.Frame descendent has a method, SetController that takes an
instance of the controller and then binds events from the wx.Frame to
methods in the controller.One refinement I made was the ability to un-bind the controller before
cleanup. I found a case where, depending on the order that things were
destroyed, an event handler tried to update a widget that had alreadybeen destroyed. Fortunately, I was able to come up with generic
un-binding code that uses the same code as SetController, so the the
un-bind method is generic. That means that you only have to hand-code
the binding of event, you don’t have to hand-code the un-binding.As I mentioned, I’ve been thinking of moving SetController out of the
wx.Frame class. Actually, I’m thinking of moving the SetController
method to a sub-class of my wx.Frame sub-class. That way it would stillbe able to access all the widgets via self. One reason I’m considering
this is I use a GUI design tool (wxGlade) to design the frame. By
splitting SetController and the other hand-coded routines into a
separate file, I can re-run wxGlade and allow it to completely re-writeit’s Python output file. With the design I have now, I have to make sure
that wxGlade doesn’t overwrite my hand-coded changes.
Mark
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail:
wxPython-users-help@lists.wxwidgets.org
–
There is NO FATE, we are the creators.