PuzzleBazar MVP description

12 views
Skip to first unread message

PhilBeaudoin

unread,
Feb 28, 2010, 3:26:39 AM2/28/10
to PuzzleBazar-Dev
I'm quite satisfied with the latest architectural changes to
PuzzleBazar's Model-View-Presenter architecture. It is diverging
further and futher away from the original gwt-presenter approach, so I
tought it might be important to spend some time describing it, which I
have done on the wiki: http://code.google.com/p/puzzlebazar/wiki/MvpArchitecture?ts=1267345053

Highlights:
- Replaced places with proxies. Each presenter has exactly one light-
weight proxy associated with it. The proxy is responsible for
listening to messages on the event bus and for instantiating the
presenter when needed.
- Members of a Presenter-View-Proxy triplet communicate by method
invocation (not the event bus)
- Presenters communicate with their parent proxy (or any other proxy)
through the even bus, leading to loose coupling of the presenters.
- The multiple types of events have been replaced by new non-typed
events. This makes it possible to use the powerful filtering mechanism
of the event bus without having to define a menagerie of event
classes.
- Presenters that display their child in tab panels now use a neat
event bus based mechanism to query their children.

All in all, I like the result quite a bit. Let me know what you think.

Coolzy

unread,
Feb 28, 2010, 8:06:25 AM2/28/10
to PuzzleBazar-Dev
ok. let me look through first. thank you @PhilBeaudoin

Michael Weisser

unread,
Mar 2, 2010, 6:58:43 AM3/2/10
to PuzzleBazar-Dev
Awesome work Philippe... Thanks for your detailed description (wiki
page) and for the major refactoring of your own presenter
implementation.

In older svn revisions you used this "Slot" mechanism stuff that I
didn't fully understand but your latest approuch looks very
interesting.

I like the lazy init "Proxy" approuch, I like the "SetContentHandler"
mechanism and the out-of-the box support for "TabContainers".

Right now i still use the gwt-presenter-replace branch in combination
with firing different type of events in the
WidgetPresenter.onRevealDisplay method to update the correct AppView
Panels.

I think i will rework my client part and integrate your current
presenter implementation. For that i want to copy your
"com.philbeaudoin.gwt.presenter.*" files into my own gwt project. I
see that there was some slight changes between r68 and r73. Are there
other changes planned already in your presenter implementation? Or
should i start going with your rev73?

Thanks again for your great work and for making all your work public.

Kind Regards
Michael

PhilBeaudoin

unread,
Mar 2, 2010, 3:39:06 PM3/2/10
to PuzzleBazar-Dev
Thanks Michael. I'm glad you're considering using this framework. I
too like the current approach quite a bit. It's relatively simple to
use and does everything I need.

The newer revision include a conditional mechanism to "warn" the user
when he is about to navigate away from a page, either by clicking an
external link or by navigating within the app. For example, it can be
used to make sure the user doesn't loose an email he has been editing
but has not yet saved. See
PlaceManager#setOnLeaveConfirmation(String).

Re: Planned changes.
I don't want to commit to not changing
com.philbeaudoin.gwt.presenter.* as I will modify it as I encounter
new requirements while writing my main app.

That being said, I don't see any major structural change in the near
future. I will add more features to the package, but I can strive to
minimize the impact on anybody using it. Some features that should/
could make it:
- (very soon) The ability to code split presenters. (Not entirely sure
how to do this now... It's the next thing on my schedule.)
- (relatively soon) Simplified annotation-based mechanism for
registering Presenter-Proxy-View triplets.
- (not soon) Some kind of non-singleton presenters, for cases where a
presenter needs to be simultaneously included in multiple places in
the DOM.
- Other tab-like presenters? If I add a generic enough type of
presenter with non-trivial logic to my app (like the tab presenters),
I'll definitely consider moving them up to the presenter package.
- Better javadoc. Unit tests. Things I never get around to doing. ;)

If you're actively using the package, I will seek your input before I
do any potentially impacting change. Also, I'd be happy to consider
adding-in improvements you have written yourself. Once I'm done with
Milestone 1 (http://code.google.com/p/puzzlebazar/wiki/
Version1Milestone1), then the presenter package should be much more
stable and I will consider releasing it stand-alone. So it's up to
you: you can start using it now and do the slight adjustments needed
as you upgrade, or you can wait a month or so until it's more stable.

Cheers, and thanks for the comments!

Philippe

On Mar 2, 3:58 am, Michael Weisser <michael.weis...@googlemail.com>
wrote:

PhilBeaudoin

unread,
Mar 2, 2010, 3:41:55 PM3/2/10
to PuzzleBazar-Dev
Forgot to add: do let me know if/when you start using it, so that I
can slow down on my trigger-happy refactorings.

Michael Weisser

unread,
Mar 10, 2010, 3:51:16 AM3/10/10
to PuzzleBazar-Dev, Philippe Beaudoin
Hello Philippe,

sorry for my late answer and thanks for all so far...

Next days i will migrate my little gwt project to your latest
frameworks used in your puzzlebazar project. And Philippe it is not
necessary that you slow down your refactorings - please modify, change
whatever you need.

At the moment my gwt project is only a smaller side project and I am
also relatively new to gwt but I prefer to build up an application in
a mature and scalable way - so I am really happy to have found your
great puzzlebazar project/architecture.

Hopefully I can contribute some useful extension to your fantastic
work but right now I am still at the beginning...

Thanks again for sharing all your work with us.

Regards
Michael

Reply all
Reply to author
Forward
0 new messages