Annoucement. PureMVC4GWT RC is available

1 view
Skip to first unread message

Luciano Broussal

unread,
Sep 17, 2008, 6:34:19 AM9/17/08
to Google Web Toolkit
Hi All,

I've created a tiny but powerful gwt project

The Goal is to provide a MVC framework based on the simple, well
designed and powerful PureMVC framework.

This offer an opportunity to have the same design patterns what ever
you code in Java, .Net, Pythom, PHP ...

Find all necessary documention on PureMVC on the offcial site
http://puremvc.org/


PureMVC4GWT is hosted on Google Code at

http://code.google.com/p/purevmc4gwt/


Feel free to try it and join me to help me to leverage it.

Regards.

Luciano Broussal

eggsy84

unread,
Sep 17, 2008, 10:27:50 AM9/17/08
to Google Web Toolkit
Hi there

I have never encountered PureMVC but have been developing using GWT
for around 10 months now.

We have come up with various methods of attempting to implement the
MVC approach through GWT none of which we have been that happy with to
be honest.

I'll read up on PureMVC and how it works first then it looks like your
implementation should be very useful! Thank you for bringing this to
my attention if I understand the concept I would definately be
interested in helping the development of puremvc4gwt!

Eggsy

---

On Sep 17, 11:34 am, Luciano Broussal <luciano.brous...@gmail.com>
wrote:
> Hi All,
>
> I've created a tiny but powerful gwt project
>
> The Goal is to provide a MVC framework based on the simple, well
> designed and powerful PureMVC framework.
>
> This offer an opportunity to have the same design patterns what ever
> you code in Java, .Net, Pythom, PHP ...
>
> Find all necessary documention on PureMVC on the offcial sitehttp://puremvc.org/

Luciano Broussal

unread,
Sep 18, 2008, 11:21:50 AM9/18/08
to Google Web Toolkit
Hope this help eggsy84.

PureMVC userguide is very well documented i think and explain also so
obvious design errors.

Thanks.


Luciano

Thomas Broyer

unread,
Sep 19, 2008, 6:11:44 AM9/19/08
to Google Web Toolkit

On 17 sep, 12:34, Luciano Broussal <luciano.brous...@gmail.com> wrote:
> Hi All,
>
> I've created a tiny but powerful gwt project
>
> The Goal is to provide a MVC framework based on the simple, well
> designed and powerful PureMVC framework.

I didn't know PureMVC, and I'm not very familiar with MVC either
(well, I know the basics but I'm far from being "used to MVC"), but
after throwing an eye at the puremvc "overview" docs and at your code
(loginsample and then some of the framework's classes), it seems like
I was having a similar idea for the next "big rewrite" of our GWT app:
mainly having a single object to publish/subscribe to (Facade).
However, I was rather thinking about using integers (or maybe a big
Enum, not the best choice as far as SoC is concerned, but easier to
maintain in order to prevent conflicts) rather than strings to
identify notifications (allows switch/case in Java and probably leads
to faster code than String comparisons; as was done with
com.google.gwt.user.client.Event's constants).

All in all, PureMVC seems a little bit over-engineered, bringing too
much overhead to the constrained environment that a web browser is...
Looks like a good and clean pattern, but I'd rather build my own
specific implementation from a "template project" than use this
generic impl... (for example: why having a Notification class and
INotification interface if you don't ever subclass/implement them? why
not just have onHandleNotification(String name, Object body, String
type) methods all over the place?)

Actually, I didn't spend much more than half an our reading PureMVC
docs and your code, so I probably missed a lot of things (btw, where's
the userguide you talked about? I couldn't find it on puremvc.org, or
is what's called "best practices"?)

Luciano Broussal

unread,
Sep 19, 2008, 1:27:42 PM9/19/08
to Google Web Toolkit
Hi,



Here is the documentation http://puremvc.org/component/option,com_wrapper/Itemid,174/.
It is available on the PureMVC Home page.

Maybe you don't like but i'm not sure you can do more simple than the
15 classes which compose PureMvc and help the developper to separate
layers and the main design patterns it use :

Proxy
Facade.
Medialor
Commands
View
Controller

Anyway, thank you for had a look to the project.

Regards

FYI a little hello would have been welcome at the beginning of your
post ;)

Luciano

Thomas Broyer

unread,
Sep 20, 2008, 3:31:06 PM9/20/08
to Google Web Toolkit
Hi Luciano,

On 19 sep, 19:27, Luciano Broussal <luciano.brous...@gmail.com> wrote:
>
> Here is the documentationhttp://puremvc.org/component/option,com_wrapper/Itemid,174/.
> It is available on the PureMVC Home page.

Thanks (so it was the thing called "best practices" ;-) )

> Maybe you don't like but i'm not sure you can do more simple than the
> 15 classes which compose PureMvc and help the developper to separate
> layers and the main design patterns it use :
>
> Proxy
> Facade.
> Medialor
> Commands
> View
> Controller

Don't get me wrong, I didn't say I dislike PureMVC or its approach,
quite the contrary actually!
Two things though:
- I'm not a fan of frameworks, I prefer libraries/toolkits and a set
of patterns
- given that the PureMVC framework preferred usage is through the
"patterns" (Façade, Proxy, Mediator, Command), why not making it
lighter with mostly those classes and a few helper classes? (e.g.
Model Controller and View are masked behind Facade, just get rid of
the singletons and

> Anyway, thank you for had a look to the project.

Some thoughts:
- PureMVC best practices, page 28, reads: "Because of its
readability, and the ease of which one may refactor to add or remove
Notifications handled, the ‘switch / case’ construct is preferred over
the ‘if / else if’ expression style inside the handleNotifications
method." Given that you cannot do switch/case on strings in Java, I'd
replace the Notification names with integer identifiers. An Enum could
be used but that would mean making the classes generics: Facade<E
extends Enum>, etc. (to be implemented as "ApplicationFacade extends
Facade<ApplicationConstants>").
- AFAIK, a Flex application must inherit mx.core.Application, so it
can't inherit Facade at the same time; hence the dichotomy; but in GWT
we implement EntryPoint, so the Facade could be the EntryPoint, with
appropriate abstract methods to avoid the need for explicitly calling
a "startup" method. This might lead to "bad uses" of the framework
though, where the façade would have direct access to
- I haven't yet read the "best practices" 'til the end but couldn't a
Mediator be a Composite?
- I'm concerned that there's no notion of "relevant" mediators at a
given time (e.g. in a tabbed app, the components outside the active
tab are "irrelevant", so handling of notifications could just be "mark
as dirty" and when the components become "relevant" again, they can re-
build or update their UI subcomponents); or should it be handled on
the "visual component" side and have the mediator handle notifications
independently of this relevant/irrelevant state)

The EntryPoint as Facade and Mediator as Composite would drastically
reduce the sample's code...

Luciano Broussal

unread,
Sep 20, 2008, 4:44:55 PM9/20/08
to Google Web Toolkit
Thomas,

Thanks for your interesting point of view.

Feel free to checkout the project and you can help me to get it
better.

Currently is a port of the java version of PureMVC but i didn't want
to change it to not loose people who already know and use PureMVC
with other languages.

Regards.

marcelo melo

unread,
Sep 24, 2008, 6:12:31 PM9/24/08
to Google-We...@googlegroups.com
Hi,

I've been working on a project with PureMVC for Flex for some time and
I really like it.

When looking at the example I've noticed a small difference from the
GWT implementation, that is the necessity of creating a Provider for
executing the Commands.

While I understand that it must be done because GWT does not let one
use reflection, I think that a small change could remove the necessity
of such Provider.
If, at the Controller and MacroCommand classes, instead of receiving
references to Class<? extends ICommand> , the parameter becomes an
instance of ICommand, and when invoking the registerCommand or
subCommand we pass a new Instance of the desired Command, it could be
achieved.

The only difference I see is that there would be always the same
reference to the Commands, instead of creating a new instance each
time. I don't know if that would be a problem.

I have the modified code, and it runs fine with the login example, and
I could send it to you (Luciano). By the way, are you brazilian?

Thanks

Luciano Broussal

unread,
Sep 25, 2008, 5:35:46 AM9/25/08
to Google Web Toolkit
Hi Marcelo,

it's a great suggest.

To anyone interested by this toolkit feel free to join the official
forum at :
http://groups.google.com/group/puremvc4gwt

Regards.

Luciano

On 25 sep, 00:12, "marcelo melo" <marcelotm...@gmail.com> wrote:
> Hi,
>
> I've been working on a project with PureMVC for Flex for some time and
> I really like it.
>
> When looking at the example I've noticed a small difference from the
> GWT implementation, that is the necessity of creating a Provider for
> executing the Commands.
>
> While I understand that it must be done because GWT does not let one
> use reflection, I think that a small change could remove the necessity
> of such Provider.
> If, at the Controller and MacroCommand classes, instead of receiving
> references to Class<? extends ICommand> , the parameter becomes an
> instance of ICommand, and when invoking the registerCommand or
> subCommand we pass a new Instance of the desired Command, it could be
> achieved.
>
> The only difference I see is that there would be always the same
> reference to the Commands, instead of creating a new instance each
> time. I don't know if that would be a problem.
>
> I have the modified code, and it runs fine with the login example, and
> I could send it to you (Luciano). By the way, are you brazilian?
>
> Thanks
>
> On Sat, Sep 20, 2008 at 5:44 PM, Luciano Broussal
>

Thomas Broyer

unread,
Sep 25, 2008, 8:29:59 AM9/25/08
to Google Web Toolkit

On 25 sep, 00:12, "marcelo melo" <marcelotm...@gmail.com> wrote:
>
> While I understand that it must be done because GWT does not let one
> use reflection, I think that a small change could remove the necessity
> of such Provider.
> If, at  the Controller and MacroCommand classes, instead of receiving
> references to Class<? extends ICommand> , the parameter becomes an
> instance of ICommand, and when invoking the registerCommand or
> subCommand we pass a new Instance of the desired Command, it could be
> achieved.
>
> The only difference I see is that there would be always the same
> reference to the Commands, instead of creating a new instance each
> time. I don't know if that would be a problem.

If you follow the "principles" of PureMVC that a command must be
"state-less", then it won't be a problem, but it allows you to write
stateful commands, whereas the pattern used in PureMVC prevents this
with throwaway instances.

Luciano Broussal

unread,
Sep 25, 2008, 8:42:25 AM9/25/08
to Google Web Toolkit
Hello Thomas,

you right.

Regards

Matthieu

unread,
Sep 25, 2008, 5:41:42 AM9/25/08
to Google Web Toolkit
Hi,

This is the solution we use in pureMvc MultiCore Edition.
But Cliff is not satisfied with it. He doesn't want that users can
manage the life cicle of a command.

We search a solution on the generator side.

Thanks for your interest.

Matthieu

Matthieu

unread,
Sep 25, 2008, 8:37:34 AM9/25/08
to Google Web Toolkit
I'm agree with you, the pureMvc MultiCore edition use instance instead
of factory.

The probleme is to allow people to write non "State-less" command.
All the "principles" will not guarantee that it will not happen.

Srini Marreddy

unread,
Sep 25, 2008, 10:42:37 AM9/25/08
to Google Web Toolkit
Hi Luciano,
It is good to know that we have a Framework for GWT. I am not
familiar with Pure MVC framework,but I would like to play with it. A
simple hello world example on how to use the framework will be very
helpful for those interested in trying this framework.

Best Regards,
Srini


On Sep 17, 5:34 am, Luciano Broussal <luciano.brous...@gmail.com>
wrote:
> Hi All,
>
> I've created a tiny but powerful gwt project
>
> The Goal is to provide a MVC framework based on the simple, well
> designed and powerful PureMVC framework.
>
> This offer an opportunity to have the same design patterns what ever
> you code in Java, .Net, Pythom, PHP ...
>
> Find all necessary documention on PureMVC on the offcial sitehttp://puremvc.org/

Luciano Broussal

unread,
Sep 25, 2008, 11:05:52 AM9/25/08
to Google Web Toolkit
Hi Srini,

Here you have a simple sample http://code.google.com/p/purevmc4gwt/downloads/list

Login Sample

HTH

Srini Marreddy

unread,
Sep 25, 2008, 11:09:17 AM9/25/08
to Google Web Toolkit
I see there is a LoginDemo sample in the project home page downloads
section. I will play with it and send my feedback.

Best,
Srini
Reply all
Reply to author
Forward
0 new messages