For your convenience, here is the net of it. With MVC, the model is
thick with business rules and glue code to a data access layer. The
view has lots of dependencies on the model. The controller is usually
a framework component driven by some kind of configuration, usually
XML based. With MVP, the model is lightweight POJOs. The view is
mockable. It is the presenter that is heavy with glue code and
business rules. The thinking here is that MVP is more suited for TDD
than MVC.
Another notable feature of MVP in GWT apps is the use of an event bus
instead of hard coded event handler dependencies. Typically, that
event bus is implemented as either the HandlerManager from GWT itself
or the PropertyChangeSupport class from the GWTx library.
MVP vs MVC - 0 views
-
In MVC, the model is heavy with business rules and data access, the view contains the presentation logic, and the controller is typically a framework component with an XML configuration to drive it. In MVP, the model is lightweight POJO value objects, the view is mockable, and the presentation is specific to the model and the view. It is the presentation that has all the dependencies and glue code for the model\nand the view. You get more code coverage in your unit testing with MVP so MVP and TDD go together.
Feedback on "Large scale app development MVP article" - Google Web Toolkit | Google Groups - 1 views
-
There are a few things that you should keep in mind before you try to understand the MVP pattern 1. You don't have reflection or observer/observable pattern on the client side. 2. Views depend on DOM and GWT UI Libraries, and are difficult to mock/emulate in a pure java test case Now, to answer some of your questions
Feedback on "Large scale app development MVP article" - Google Web Toolkit | Google Groups - 0 views
-
There are a few things that you should keep in mind before you try to understand the MVP pattern 1. You don't have reflection or observer/observable pattern on the client side. 2. Views depend on DOM and GWT UI Libraries, and are difficult to mock/emulate in a pure java test case Now, to answer some of your questions
DockLayoutPanel MVP and events - Google Web Toolkit | Google Groups - 0 views
-
he generally adopted way of doing things in GWT is to have custom events go through the event bus. In this case, you're talking about "navigation", so maybe the concept of "place" would be better than "just" some custom event. I encourage you to look at gwt-platform, gwt- presenter and other MVP frameworks for GWT, and/or look at the Activity concept from the upcoming GWT 2.1. Using actvities, you'd have an ActivityManager managing your "center". The tree would use the PlaceController.goTo to navigate to a new "place". An ActivityMapper (that you passed to the ActivityManager in the constructor) would map the place to an Activity (a presenter), and the ActivityManager will manage the current Activity for the display it manages, i.e.it will stop() the current activity if its ok (willStop returns true) and then only start the new Activity, which will call the Display back to show its view. The tree would probably also listen to PlaceChangeEvent on the event bus to update the selected item depending on the current place (in case some other component calls the PlaceController.goTo)
How to avoid Spring Roo GWT support? - Stack Overflow - 0 views
-
you can separate your project into two modules: A module containing model and persistence code that is created by Spring Roo A GWT web application that you create by hand. Make the first (Roo) module a dependency of the second (GWT) module. Basically you're using Roo to create a JAR library that's used by your web application. As long as you don't run the controller command the Roo won't add any web application code to your module.
DockLayoutPanel MVP and events - Google Web Toolkit | Google Groups - 0 views
-
he generally adopted way of doing things in GWT is to have custom events go through the event bus. In this case, you're talking about "navigation", so maybe the concept of "place" would be better than "just" some custom event. I encourage you to look at gwt-platform, gwt- presenter and other MVP frameworks for GWT, and/or look at the Activity concept from the upcoming GWT 2.1.
-
Using actvities, you'd have an ActivityManager managing your "center". The tree would use the PlaceController.goTo to navigate to a new "place". An ActivityMapper (that you passed to the ActivityManager in the constructor) would map the place to an Activity (a presenter), and the ActivityManager will manage the current Activity for the display it manages, i.e.it will stop() the current activity if its ok (willStop returns true) and then only start the new Activity, which will call the Display back to show its view. The tree would probably also listen to PlaceChangeEvent on the event bus to update the selected item depending on the current place (in case some other component calls the PlaceController.goTo)
GWT MVP Development with Activities and Places - Google Web Toolkit - Google Code - 1 views
-
Views A key concept of MVP development is that a view is defined by an interface. This allows multiple view implementations based on client characteristics (such as mobile vs. desktop) and also facilitates lightweight unit testing by avoiding the time-consuming GWTTestCase. There is no View interface or class in GWT which views must implement or extend; however, GWT 2.1 introduces an IsWidget interface that is implemented by most Widgets as well as Composite. It is useful for views to extend IsWidget if they do in fact provide a Widget. Here is a simple view from our sample app. public interface GoodbyeView extends IsWidget { void setName(String goodbyeName);} The corresponding implementation extends Composite, which keeps dependencies on a particular Widget from leaking out. public class GoodbyeViewImpl extends Composite implements GoodbyeView { SimplePanel viewPanel = new SimplePanel(); Element nameSpan = DOM.createSpan(); public GoodbyeViewImpl() { viewPanel.getElement().appendChild(nameSpan); initWidget(viewPanel); } @Override public void setName(String name) { nameSpan.setInnerText("Good-bye, " + name); }}
-
A place in GWT 2.1 is a Java object representing a particular state of the UI. A Place can be converted to and from a URL history token (see GWT's History object) by defining a PlaceTokenizer for each Place, and the PlaceHistoryHandler automatically updates the browser URL corresponding to each Place in your app.
-
Place
- ...2 more annotations...
GWT MVP Development with Activities and Places - Google Web Toolkit - Google Code - 2 views
-
An activity in GWT 2.1 is analogous to a presenter in MVP terminology. It contains no Widgets or UI code. Activities are started and stopped by an ActivityManager associated with a container Widget. A powerful new feature in GWT 2.1 is that an Activity can automatically display a warning confirmation when the Activity is about to be stopped (such as when the user navigates to a new Place). In addition, the ActivityManager warns the user before the window is about to be closed.
-
A place in GWT 2.1 is a Java object representing a particular state of the UI. A Place can be converted to and from a URL history token (see GWT's History object) by defining a PlaceTokenizer for each Place, and the PlaceHistoryHandler automatically updates the browser URL corresponding to each Place in your app.
-
A key concept of MVP development is that a view is defined by an interface.
- ...23 more annotations...
design pattern for common functionality between Activities - Google Web Toolkit | Googl... - 0 views
-
How I understand things, a display region is a dynamic part of a webpage; Depending on the place you're at, a display region is populated with a specific activity. A activity manager is the manager of a display region and decides the right activity to show up for a given display region when a certain page is showing. So, in terms of your question : a display region can be a dynamic menu, a sidebar, a logout/login link.... not the entire group. An example page with menu displayregion, maincontent displayregion, sidebar displayregion example page #ContactDetailsPage:FooBar +> sidebar display region will be instructed by the sidebar- activitymanager to start the activity GrandChildrenActivity (display grandchildren in side bar) +> maincontact display region will be instructed by the maincontentarea-activitymanager to start the activity ContactDetailsActivity (display contact details in main content area) +> menu display region will be instructed by the menu-activitymanager to start the activity MenuActivity (show the menu) example page #Login +> sidebar display region will be instructed by the sidebar- activitymanager to display nothing (NULL) +> maincontact display region will be instructed by the maincontentarea-activitymanager to start the activity LoginActivity (display login page) +> menu display region will be instructed by the menu-activitymanager to start the activity WelcomeActivity (show a welcome msg) etc etc.
-
places and activities are orthogonal to each other a webpage consists of many display regions every display region is managed by a activity manager when a place change occurs, the activity managers are notified and they decide the activity to live inside the display region
-
Actually HelloMVP is a really confusing example, because - the activities are called HelloActivity and GoodbyeActivity - the places are called HelloPlace and GoodbyePlace but the activities and places are orthogonal to each other. That doesn't help to get a clearer understanding.
Ray Ryan, best practices and embracing asynchronicity - Google Web Toolkit | Google Groups - 0 views
-
Doing this well depends on some form of centralized data retrieve dispatch/caching. You make calls to this centralized service to get the objects by id that you are interested in. It either finds them in cache and can return them immediately, or adds them to a queue of objects to retrieve. After all requests have been made (ie on DeferredCommand), a single request is sent to retrieve all objects of all types needed.
-
You could use an event bus to indicate all the objects where data is now available. This could even be a single event instead of one for each object, and the event handlers can ask if their objects of interest are now available, avoiding multiple updates.
1 - 13 of 13
Showing 20▼ items per page