没有任何数据可供显示
| 开源项目社区 | 当前位置 : |
|
| www.trustie.net/open_source_projects | 主页 > 开源项目社区 > mvp4g |
|
mvp4g
|
| 3 | 0 | 342 |
| 贡献者 | 讨论 | 代码提交 |
The goal of the Mvp4g framework is to help you build GWT applications easily, following best practices shown by Ray Ryan at the Google I/O:
Event Bus Dependency Injection Model View Presenter Place Service (see http://code.google.com/events/io/2009/sessions/GoogleWebToolkitBestPractices.html for the video or http://extgwt-mvp4g-gae.blogspot.com/2009/10/gwt-app-architecture-best-practices.html for the text, thanks to Araik Minosian.)
The framework allows you to easily:
Set an event bus. Configure which presenter handles an event. Inject a view and one or more services into the presenter. Manage history thanks to a Place Service (NEW) Take advantage of new GWT 2.0 features like GWT code splitting (thanks to Mvp4g Multi-modules features) (NEW) Optimize your application (in particular thanks to Lazy Loading, build your views and presenters only when you need it, see Mvp4g optimization)
And now you can do all this thanks to one interface and a few annotations (or you can still use a XML configuration file). Moreover when you use an interface and annotations, you have a strongly typed event bus.
This is all you need to create an event bus with four events:
@Events( startView = CompanyListView.class, module = CompanyModule.class, debug = false )
public interface CompanyEventBus extends EventBus {
@Event( handlers = CompanyEditPresenter.class )
public void goToEdit( CompanyBean company );
@Event( handlers = CompanyDisplayPresenter.class )
public void goToDisplay( CompanyBean company );
@Event( handlers = { CompanyListPresenter.class, CompanyDisplayPresenter.class } )
public void companyCreated( CompanyBean newBean );
@Event( handlers = CompanyListPresenter.class )
public void companyDeleted( CompanyBean newBean );
}To understand how the framework works, you can look at the documentation.
Examples are also provided to illustrate the framework:
TestMvp4gA basic example to easily understand how the framework works. UML diagram of this example is available here (thanks to Steffen Nissen) EmployeeAdminThe GWT PureMvc example (as shown here) but implemented with the Mvp4g framework. This example also illustrates how to easily unit test the presenters using JUnit directly (without GWTTestCase, you can look at this message to see an example with a Mock library). EmployeeAdmin with GXTSame example as EmployeeAdmin but implemented with GXT using different approaches (see Mvp4g and GXT post) Mvp4gHistoryThis example shows how history is managed thanks to a Place Service. (see the wiki page for more information). Mvp4gModules & Mvp4gModulesXML These examples demonstrate how you can divide your application into modules and take advantage of GWT 2.0 Code splitting feature. It also shows how history is automatically managed with sub-modules.
One version has been implemented with an Event bus interface, the other one with a XML configuration file. MailWithMvp4gThis example shows the GWT Mail example converted with Mvp4g. It illustrates how Mvp4g can be used with UiBinder. Mvp4gWithEdgeboxThis is a really simple example to show how you can use an external library to make non-RPC calls to the server.
You can test these examples thanks to the Showcase.
Don't hesitate to let me know your comments and any ideas you have to improve the framework.
To ensure quality, library code is covered by JUnit tests (See coverage summary result or See full covery result)
标签:
