Re: Who handles UI rules...the Activity?
The view part of a pure MVP design is entirely passive. It will
expose (via an interface) a set of methods and widgets (interfaces
only) to the presenter, and thats pretty much it. It takes no action
on its own, or at least as little as it can get away with given
whatever framework restrictions you may have. Your presenter will
listen for events from the view (via the Add*Handler methods on the
widget interfaces), and in response to those events, it will set
values on the widgets, call methods on the view to change its
appearance, make service calls, etc.
In short, the only active part in an MVP design is the presenter. All
application logic resides there, and its only knowledge of the outside
world is via the set of interfaces handed to it by whatever constructs
your presenters.
-Ben
On Jan 17, 5:50 am, Jeroen Wolff <jeroen.wo...@gmail.com> wrote:
> Hi, i try to figure out where the decision logic is programmed when a
> user answers a question via a radio-button.
> I am designing an form application and want to know where to put al
> the decisions rules.
> For example:
> - a user selects a radio button and based on that click a extra
> question will be shown in the view.
> - a user push add button and new block of data with question will be
> shown
>
> In view:
>
> @UIHandler("question_yes")
> void onClickYes(ClickEvent e) {
> presenter.handleYesQuestionClicked()
>
> }
>
> But how can the Activity tell the View to add or show a widget? So
> there will be some logic also in the View?
>
> Is this the 'right' way?
>
> Regards,
>
> Jeroen Wolff
--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home