Hi Alejandro,

Firstly, you can absolutely do it using the same EventBus. I just
don't think it's that great a fit, personally. But if what you have
works, use it :)

> > 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.

Yes. The example in the presentation essentially had a custom
implementation of AsyncCallback for each Action. Each one would have a
custom response, which may or may not trigger a unique event into the
EventBus. So far, exactly what my current system does - it just
provides the 'Dispatch' RPC service for you, without hooking into the
EventBus system.

However, my app has it's own subclass of the dispatcher which _does_
trigger an event, if the Response supports it. But, the original call,
and the actual action execution is not done via events - just a
notification after the Command has executed successfully (or
otherwise).

> > 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.

Well, possibly. If you like the idea of a system-wide error handler.
It's good for general or unexpected errors, but if I submit a form and
there are validation errors, I will probably want to provide more
localised feedback. Also, I might want to perform a follow-up action,
such as highlight a particular field with an error, or whatever. I
can't be sure when I receive a 'Error' event that the source was my
original request - the source will have been sent to the server and
back since then...

Anyway, there are ways to do it of course. I'll be interested to see
your solution if you make it public :)

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

Reply via email to