Re: Command Pattern, MVP, EventBus

2009-07-24 Thread Kwhit
Are your responses also in the form of events, where the traditional response value is the payload of a new event object?  For either server error or validation error, are you sending back a different event, or setting a flag inside the expected return event? Yes currently all

Re: Command Pattern, MVP, EventBus

2009-07-24 Thread Kwhit
On Jul 23, 3:11 pm, Eduardo Nunes esnu...@gmail.com wrote: Shouldn't the server errors be treated as unchecked exceptions (extends RuntimeException)? Maybe a solution could be three methods, I've found my self coding RE's for just about everything now. I think they are the most undervalued

Re: Command Pattern, MVP, EventBus

2009-07-24 Thread Eduardo Nunes
I use exceptions in this way: - RuntimeException for all those things that shouldn't happen in a normal environment. For example, databases/files problems, requests of objects using wrong ids (something like the user changed the id in the url to a wrong one). And I just shown a default error

Re: Command Pattern, MVP, EventBus

2009-07-24 Thread Eduardo Nunes
I call them BusinessException and BusinessUncheckedException BusinessException has the message key and an array of parameters, so I can build pretty error messages in the client side. On Fri, Jul 24, 2009 at 11:11 AM, Eduardo Nunesesnu...@gmail.com wrote: I use exceptions in this way: -

Re: Command Pattern, MVP, EventBus

2009-07-23 Thread Kwhit
I think Jason has hit the nail on the head. The reason I got uncomfortable with the HasXxx's is that they expose the internal workings of the Viewer (Display in RR's terms). The name getSelectionButton() is a clue. The presenter doesn't and shouldn't care about how the Viewer decides how to trip

Re: Command Pattern, MVP, EventBus

2009-07-23 Thread Kwhit
See above positing ... 2/ Define Viewer interface (without thinking about how the Viewer might be implemented) ... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send

Re: Command Pattern, MVP, EventBus

2009-07-23 Thread Thomas Broyer
On 23 juil, 10:20, Kwhit kwhitting...@gmail.com wrote: I think Jason has hit the nail on the head. The reason I got uncomfortable with the HasXxx's is that they expose the internal workings of the Viewer (Display in RR's terms). The name getSelectionButton() is a clue. The presenter

Re: Command Pattern, MVP, EventBus

2009-07-23 Thread Nathan Wells
Small note... could show it next to the sign-in button for example). The generic AsyncCallback#onFailure processing is only used for unexpected server errors. On a successful login, then either the presenter or the If you prefer to have your failed authentication throw an exception (which is

Re: Command Pattern, MVP, EventBus

2009-07-23 Thread Eduardo Nunes
Shouldn't the server errors be treated as unchecked exceptions (extends RuntimeException)? Maybe a solution could be three methods, one for failures (unchecked exceptions), one for errors (checked exceptions) and another one for success. What do you think? Best regards, On Thu, Jul 23, 2009 at

Re: Command Pattern, MVP, EventBus

2009-07-23 Thread Daniel Jue
@kwhittingham I found your implementation interesting. The current implementation: * Adds a generic RPC mechanism (the pipe) * Doesn't use the command pattern. Instead everything is an event. Selected events from the event bus are sent over the pipe and responses are fired back. This

Re: Command Pattern, MVP, EventBus

2009-07-22 Thread Kwhit
A short update on the original posting. I've now implemented the pattern I suggested in the original post in a reference application and it's running. My goals for doing the work were to address two issues: 1/ My GWT/GAE productivity: after a short learning curve it had sped up but it slowed

Re: Command Pattern, MVP, EventBus

2009-07-22 Thread Thomas Broyer
On 22 juil, 04:07, Jason A. Beranek jason.bera...@gmail.com wrote: I've been looking at the place service as well, but while I don't agree with exactly the structure in David Peterson's example, I'm not sure if the place service should fire an IssueEditEvent that drives some UI change. From

Re: Command Pattern, MVP, EventBus

2009-07-22 Thread Jason A. Beranek
On Jul 22, 3:51 am, Thomas Broyer t.bro...@gmail.com wrote: They're IMO as easy to parse as path-like tokens like Gmail uses; it's just a matter of taste (and how you'd like to model your internal API) Agree that the implementation depends on the model for an applications internal API. Part

Re: Command Pattern, MVP, EventBus

2009-07-22 Thread Jason A. Beranek
On Jul 22, 6:59 am, Daniel Wellman etl...@gmail.com wrote: So it seems it's a tradeoff in how much test coverage you need -- expose the low-level HasXyz interfaces in your view if you need more automated test code coverage, or use a gateway interface to the view which exposes higher-level

Re: Command Pattern, MVP, EventBus

2009-07-21 Thread Eduardo Nunes
About the gwt-presenter library, I found some points that I would like talk to you: - When I extend WidgetPresenter/BasicPresenter I have to implement many abstract methods, is it really necessary to set those methods as abstract? Isn't it better to provide an empty default implementation? I know

Re: Command Pattern, MVP, EventBus

2009-07-21 Thread Thomas Broyer
On 15 juil, 21:36, David Peterson da...@randombits.org wrote: Presenter Pattern API: http://code.google.com/p/gwt-presenter I wouldn't have made the place a part of the presenter (it isn't any different than the presenter registering itself a change handler on History). The whole point of

Re: Command Pattern, MVP, EventBus

2009-07-21 Thread Eduardo Nunes
On Tue, Jul 21, 2009 at 7:07 PM, Thomas Broyert.bro...@gmail.com wrote: On 15 juil, 21:36, David Peterson da...@randombits.org wrote: Presenter Pattern API: http://code.google.com/p/gwt-presenter I wouldn't have made the place a part of the presenter (it isn't any different than the

Re: Command Pattern, MVP, EventBus

2009-07-21 Thread Jason A. Beranek
I've been looking at the place service as well, but while I don't agree with exactly the structure in David Peterson's example, I'm not sure if the place service should fire an IssueEditEvent that drives some UI change. From the Ray Ryan presentation, my impression is the Place Service functions

Re: Command Pattern, MVP, EventBus

2009-07-18 Thread David Peterson
I really think it's a purely philosophical decision - I can see how it would work fine with EventBus, I'm just choosing not to, basically. For me the line in the sand is that events are about information, commands are about action. Your mileage may vary :) David On Jul 18, 7:22 am, Kwhit

Re: Command Pattern, MVP, EventBus

2009-07-17 Thread David Peterson
Fair point :) On Jul 16, 9:32 pm, Daniel Jue teamp...@gmail.com wrote: Alejandro's source code is here: http://code.google.com/p/puntosoft/ Anyway, there are ways to do it of course. I'll be interested to see your solution if you make it public :)

Re: Command Pattern, MVP, EventBus

2009-07-17 Thread Kwhit
On Jul 15, 9: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

Re: Command Pattern, MVP, EventBus

2009-07-16 Thread David Peterson
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

Re: Command Pattern, MVP, EventBus

2009-07-16 Thread Daniel Jue
Alejandro's source code is here: http://code.google.com/p/puntosoft/ Anyway, there are ways to do it of course. I'll be interested to see your solution if you make it public :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: Command Pattern, MVP, EventBus

2009-07-15 Thread Alejandro D. Garin
Hi David, On Wed, Jul 15, 2009 at 4:36 PM, David Peterson da...@randombits.orgwrote: 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

Re: Command Pattern, MVP, EventBus

2009-07-14 Thread Alejandro D. Garin
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.

Re: Command Pattern, MVP, EventBus

2009-07-14 Thread Alejandro D. Garin
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.comwrote: Hi, I wrote an implementation (first try) based on the Command Pattern and EventBus described in the Ray Google

Re: Command Pattern, MVP, EventBus

2009-07-13 Thread David Peterson
There's certainly nothing to stop you, and you could even just add your own RPC Event and have a listener trigger the server-side call. In fact, in my own implementation of Ray's example (http:// code.google.com/p/gwt-dispatch), the Action and Response are both interfaces, so you could just have

Re: Command Pattern, MVP, EventBus

2009-07-11 Thread Adligo
Hi Kwhit, I believe that this is what I have been calling the Controller (Event Bus, passing Events (Command Objects)). Perhaps why I have had some difficulty working with others (GWT) MVC frameworks of late. So I have a Event Object (Command) with a Object value field