Yes I am. I think is it rather nice little MVC implementation, which has made it more easy for us to make components talk to each other in a loosely coupled way.
Minus is however, that it easy also to create a spider web of notifications that is hard to overview.
But common sense and "keep it simple" should be used here :-)
/Flemming
On Thu, Oct 23, 2008 at 1:48 PM, marcelo melo <marcelotm...@gmail.com>wrote:
Totally agree with you... Simplicity is key most of the times (at least it should :) ).
I have one question that is really annoying me. Having used it (puremv) with Flex, it is easy to fire an event at the View and associate it with a method at the Mediator. But, how to deal with it on GWT? I am adding the Mediator as the event listener of the View (by making it implement the relevant View listeners - ClickListener, etc.), but I'm not quite sure if it's the best way to do it...
<flemming.bol...@gmail.com> wrote: > Yes I am. I think is it rather nice little MVC implementation, which has > made it more easy for us to make > components talk to each other in a loosely coupled way.
> Minus is however, that it easy also to create a spider web of notifications > that is hard to overview.
> But common sense and "keep it simple" should be used here :-)
> /Flemming
> On Thu, Oct 23, 2008 at 1:48 PM, marcelo melo <marcelotm...@gmail.com> > wrote:
Hi We have done it like the mediator has a reference to the view (which implements a gwt- neutral interface).
The View has a "hard reference" the mediator.
We want the mediator to be "unaware" of GWT because that means we are able to perform many junit tests of the "gui" without using the GETTestCase....which is a "no-go" Testcase :-)
Please let me hear how you progress and the experiences you have with puremvc....
/FLeming
On Thu, Oct 23, 2008 at 2:11 PM, marcelo melo <marcelotm...@gmail.com>wrote:
> Totally agree with you... Simplicity is key most of the times (at > least it should :) ).
> I have one question that is really annoying me. Having used it > (puremv) with Flex, it is easy to fire an event at the View and > associate it with a method at the Mediator. But, how to deal with it > on GWT? I am adding the Mediator as the event listener of the View (by > making it implement the relevant View listeners - ClickListener, > etc.), but I'm not quite sure if it's the best way to do it...
> Any ideas?
> Thanks!
> On Thu, Oct 23, 2008 at 9:53 AM, Flemming Boller > <flemming.bol...@gmail.com> wrote: > > Yes I am. I think is it rather nice little MVC implementation, which has > > made it more easy for us to make > > components talk to each other in a loosely coupled way.
> > Minus is however, that it easy also to create a spider web of > notifications > > that is hard to overview.
> > But common sense and "keep it simple" should be used here :-)
> > /Flemming
> > On Thu, Oct 23, 2008 at 1:48 PM, marcelo melo <marcelotm...@gmail.com> > > wrote:
I have used Guice and Gin to implements MVC framework(like backend spring framework). By this way view(ui), event Listener and data access(xmlHttpReqeust wrapped by REST-GWT) can be seperated by three layers.
Gin module used to initialize and couple all the instance used in the GWT module. It's a typicall Ioc container. I found it is rocking by this way in my project.
Sammi
On Thu, Oct 23, 2008 at 8:06 AM, Flemming Boller <flemming.bol...@gmail.com>wrote:
> Hi > We have done it like the mediator has a reference to the view (which > implements a gwt- neutral interface).
> The View has a "hard reference" the mediator.
> We want the mediator to be "unaware" of GWT because that means we are able > to perform many junit tests of the "gui" > without using the GETTestCase....which is a "no-go" Testcase :-)
> Please let me hear how you progress and the experiences you have with > puremvc....
> /FLeming
> On Thu, Oct 23, 2008 at 2:11 PM, marcelo melo <marcelotm...@gmail.com>wrote:
>> Totally agree with you... Simplicity is key most of the times (at >> least it should :) ).
>> I have one question that is really annoying me. Having used it >> (puremv) with Flex, it is easy to fire an event at the View and >> associate it with a method at the Mediator. But, how to deal with it >> on GWT? I am adding the Mediator as the event listener of the View (by >> making it implement the relevant View listeners - ClickListener, >> etc.), but I'm not quite sure if it's the best way to do it...
>> Any ideas?
>> Thanks!
>> On Thu, Oct 23, 2008 at 9:53 AM, Flemming Boller >> <flemming.bol...@gmail.com> wrote: >> > Yes I am. I think is it rather nice little MVC implementation, which >> has >> > made it more easy for us to make >> > components talk to each other in a loosely coupled way.
>> > Minus is however, that it easy also to create a spider web of >> notifications >> > that is hard to overview.
>> > But common sense and "keep it simple" should be used here :-)
>> > /Flemming
>> > On Thu, Oct 23, 2008 at 1:48 PM, marcelo melo <marcelotm...@gmail.com> >> > wrote:
> I have used Guice and Gin to implements MVC framework(like backend spring
> framework). By this way view(ui), event Listener and data
> access(xmlHttpReqeust wrapped by REST-GWT) can be seperated by three layers.
> Gin module used to initialize and couple all the instance used in the GWT
> module. It's a typicall Ioc container. I found it is rocking by this way in
> my project.
> Sammi
> On Thu, Oct 23, 2008 at 8:06 AM, Flemming Boller
> <flemming.bol...@gmail.com>wrote:
> > Hi
> > We have done it like the mediator has a reference to the view (which
> > implements a gwt- neutral interface).
> > The View has a "hard reference" the mediator.
> > We want the mediator to be "unaware" of GWT because that means we are able
> > to perform many junit tests of the "gui"
> > without using the GETTestCase....which is a "no-go" Testcase :-)
> > Please let me hear how you progress and the experiences you have with
> > puremvc....
> > /FLeming
> > On Thu, Oct 23, 2008 at 2:11 PM, marcelo melo <marcelotm...@gmail.com>wrote:
> >> Totally agree with you... Simplicity is key most of the times (at
> >> least it should :) ).
> >> I have one question that is really annoying me. Having used it
> >> (puremv) with Flex, it is easy to fire an event at the View and
> >> associate it with a method at the Mediator. But, how to deal with it
> >> on GWT? I am adding the Mediator as the event listener of the View (by
> >> making it implement the relevant View listeners - ClickListener,
> >> etc.), but I'm not quite sure if it's the best way to do it...
> >> Any ideas?
> >> Thanks!
> >> On Thu, Oct 23, 2008 at 9:53 AM, Flemming Boller
> >> <flemming.bol...@gmail.com> wrote:
> >> > Yes I am. I think is it rather nice little MVC implementation, which
> >> has
> >> > made it more easy for us to make
> >> > components talk to each other in a loosely coupled way.
> >> > Minus is however, that it easy also to create a spider web of
> >> notifications
> >> > that is hard to overview.
> >> > But common sense and "keep it simple" should be used here :-)
> >> > /Flemming
> >> > On Thu, Oct 23, 2008 at 1:48 PM, marcelo melo <marcelotm...@gmail.com>
> >> > wrote:
> >> >> Hi, is anyone using PureMVC for Java / GWT?
On 23 oct, 19:09, "yunhui song" <songyunhui2...@gmail.com> wrote:
> Hi
> I have used Guice and Gin to implements MVC framework(like backend spring
> framework). By this way view(ui), event Listener and data
> access(xmlHttpReqeust wrapped by REST-GWT) can be seperated by three layers.
> Gin module used to initialize and couple all the instance used in the GWT
> module. It's a typicall Ioc container. I found it is rocking by this way in
> my project.
I'm curious how you're binding event listeners using Gin.
Would you mind sharing some code?
Ok, that sounds like a good idea, especially concerning unit testing. I was avoiding to couple the View with the Mediator, but now your advice makes sense to mee.
<flemming.bol...@gmail.com> wrote: > Hi > We have done it like the mediator has a reference to the view (which > implements a gwt- neutral interface).
> The View has a "hard reference" the mediator.
> We want the mediator to be "unaware" of GWT because that means we are able > to perform many junit tests of the "gui" > without using the GETTestCase....which is a "no-go" Testcase :-)
> Please let me hear how you progress and the experiences you have with > puremvc....
> /FLeming
> On Thu, Oct 23, 2008 at 2:11 PM, marcelo melo <marcelotm...@gmail.com> > wrote:
>> Totally agree with you... Simplicity is key most of the times (at >> least it should :) ).
>> I have one question that is really annoying me. Having used it >> (puremv) with Flex, it is easy to fire an event at the View and >> associate it with a method at the Mediator. But, how to deal with it >> on GWT? I am adding the Mediator as the event listener of the View (by >> making it implement the relevant View listeners - ClickListener, >> etc.), but I'm not quite sure if it's the best way to do it...
>> Any ideas?
>> Thanks!
>> On Thu, Oct 23, 2008 at 9:53 AM, Flemming Boller >> <flemming.bol...@gmail.com> wrote: >> > Yes I am. I think is it rather nice little MVC implementation, which >> > has >> > made it more easy for us to make >> > components talk to each other in a loosely coupled way.
>> > Minus is however, that it easy also to create a spider web of >> > notifications >> > that is hard to overview.
>> > But common sense and "keep it simple" should be used here :-)
>> > /Flemming
>> > On Thu, Oct 23, 2008 at 1:48 PM, marcelo melo <marcelotm...@gmail.com> >> > wrote:
Actually, Gin is used to implements Ioc Container. It can bind everything not only event Listener.
Guice or Spring can do that naturally, but because GWT can not support Java reflection, such as forClass("className").getInstance. So Gin use generic and annotation to do that.
I have a open source project to do that. GinModule and GindInjector are key players for that. please check out here, that's a real world project. http://openorg.googlecode.com/svn/trunk/magpie
On Fri, Oct 24, 2008 at 3:39 AM, Thomas Broyer <t.bro...@gmail.com> wrote:
> On 23 oct, 19:09, "yunhui song" <songyunhui2...@gmail.com> wrote: > > Hi
> > I have used Guice and Gin to implements MVC framework(like backend > spring > > framework). By this way view(ui), event Listener and data > > access(xmlHttpReqeust wrapped by REST-GWT) can be seperated by three > layers.
> > Gin module used to initialize and couple all the instance used in the > GWT > > module. It's a typicall Ioc container. I found it is rocking by this way > in > > my project.
> I'm curious how you're binding event listeners using Gin. > Would you mind sharing some code?
On 27 oct, 00:09, "yunhui song" <songyunhui2...@gmail.com> wrote:
> Hi,
> Actually, Gin is used to implements Ioc Container. It can bind everything
> not only event Listener.
> Guice or Spring can do that naturally, but because GWT can not support
> Java reflection, such as forClass("className").getInstance. So Gin use
> generic and annotation to do that.
Sorry, I should have been clearer: I know what Guice (and Gin) and
Spring are. Just that they cannot AFAIK inject listeners (i.e. call
some addXListener method, eventually several times on a single
instance). Of course you can use method injection with a
setXListeners(List<XListener>) method (should be supported by Gin as
of today) but I wouldn't call it "injecting event listeners"; or
inject event sources or event targets but that's not flexible at all
(why having "event listeners" in this case, just keep references to
the injected widgets and call the appropriate methods on them)
> I have a open source project to do that. GinModule and GindInjector are
> key players for that.
> please check out here, that's a real world project.
> http://openorg.googlecode.com/svn/trunk/magpie
I've seen some widgets be injected other widgets but not a single
event listener (or I missed something).
> I've seen some widgets be injected other widgets but not a single
event listener (or I missed something).
It's true that for my project I only injected some widgets on a main panel. That's the project specific choice. Because it's more easy to do that.
I'am not very clear your use case now. Let me have a guess for the use case:
1. We have two widgets w1 and w2, both of them would fire Event clickEvent.
2. We need one Event Listener named CommonEventListener, we expect it can be used to process clickEvent fired from both w1 and w2.
3. We hope the container, that is Gin to inject when system initialize. So refractor the code like. W1 w1 = new W1(); w1.addClickEventListener(new CommonEventListener(p1,p2){});
W2 w2 = new W2(); w2.addClickEventListener(new CommonEventListener(p1,p2){}); by:
Because polymorphism is not usable in GWT, we can not use W1 or W2's common interface or base class as CommonEventListener. My suggestion is:
private W1 w1; private W2 w2; @inject public CommonEventListener(W1 w1,W2 w2){ //w1 and w2 should be created by ginmodule as singleton instance. this.w1 = w1; this.w2 = w2;
I don't think it's an perfect solution(you must change the parameter, as you said, use List<T> is same like ). But it should be able to manage the listener and ui creation by container and unit test could be implemented easily.
> > Actually, Gin is used to implements Ioc Container. It can bind > everything > > not only event Listener.
> > Guice or Spring can do that naturally, but because GWT can not support > > Java reflection, such as forClass("className").getInstance. So Gin use > > generic and annotation to do that.
> Sorry, I should have been clearer: I know what Guice (and Gin) and > Spring are. Just that they cannot AFAIK inject listeners (i.e. call > some addXListener method, eventually several times on a single > instance). Of course you can use method injection with a > setXListeners(List<XListener>) method (should be supported by Gin as > of today) but I wouldn't call it "injecting event listeners"; or > inject event sources or event targets but that's not flexible at all > (why having "event listeners" in this case, just keep references to > the injected widgets and call the appropriate methods on them)
> > I have a open source project to do that. GinModule and GindInjector > are > > key players for that. > > please check out here, that's a real world project. > > http://openorg.googlecode.com/svn/trunk/magpie
> I've seen some widgets be injected other widgets but not a single > event listener (or I missed something).