Hi David,

On Wed, Jul 15, 2009 at 4:36 PM, David Peterson <da...@randombits.org>wrote:

>
> Thinking further, I think it's better to separate the EventBus from
> the Command system somewhat. The reason being that generally, events
> are used to update on changes that have already happened, or are about
> to happen. They don't trigger the actual event itself.
>

My understanding is that some Events need to be fired from the RPC Service
(see slide #46 from Ray talk). In my example I have events like
EmployeeAddEvent fired only when the RPC call is returned sucessfull, then
all views listening this event are notified.


> For example, you have a 'CreateUserEvent'. This is sent out and three
> listeners pick it up. There is no way to control the order the
> handlers are sent the event, so one might actually create the user,
> and the others expect it to already be created. You'll have issues at
> that point. Also, what happens if the creation fails? Should the event
> keep propogating, or stop?


I didn't understand your point. I have four listeners and each listener is
receiving a diferent Event, then one listener receive employee aditions,
other listener employee deletes, etc.
(lines 114 to 166)

It's also more difficult to provide feedback to the original creator
> if there were problems. Yes, it could send out another event over the
> bus, but then you end up with custom 'error' events all over the
> place...
>

If an error ocurr with the RPC request then the application wide failure
handling (see slide #24) will notify the user about the error. There is no
need for new events.


>
> Anyway, I've ended up implementing them separately. In fact, they are
> completely decoupled from each other - so much so that I've got two
> separate projects for them:
>
> Command Pattern API:
> http://code.google.com/p/gwt-dispatch
>
> Presenter Pattern API:
> http://code.google.com/p/gwt-presenter


Thanks about your comments, I will check your project and send my feedback.
Regards,


>
> On Jul 15, 2:46 am, "Alejandro D. Garin" <aga...@gmail.com> wrote:
> > I forget to post the link:
> >
> > http://puntosoft2k.appspot.com/Showcase.html#ContactWidgetEventBus
> >
> > Thanks.
> >
> > On Tue, Jul 14, 2009 at 1:43 PM, Alejandro D. Garin <aga...@gmail.com
> >wrote:
> >
> > > Hi,
> >
> > > I wrote an implementation (first try) based on the Command Pattern and
> > > EventBus described in the Ray Google IO Talk. (what I understand from
> the
> > > slides).
> > > The working example is trivial but the code uses an event bus (using
> gwt
> > > HandleManager) and the command pattern for the RPC Service.
> >
> > > Comments are welcome, I would like to know if the implementation is
> good.
> >
> > > Thanks,
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to