Saturday, June 25, 2011

Day 3: GWT Platform MVP

The plugin from these guys are AMAZING. They make MVP pattern design and structure so much easier for developer. With just a click of button and your Presenter, View and UiBinder are ready to go. I am highly recommended this library for productive development with GWT. I mean it just make thing so much faster and ORGANIZE! You know what is even cooler? They have Nested Presenter! What is Nested Presenter you asked?

Remember the good old PHP when you want to include header and footer then you would do this


CONTENT


..Unfortunately with GWT you can't do something like that. Well, you can if you define your layout as a widget and include it everywhere within your new view's UiBinder. Now, thats too much work and hassle. Imagine if you have 1000 views? That would be 3,000 extra lines of code (header widget, footer widget and sidebar widget). With GWTP, you only have to change the following once you defined your header/footer file

RevealRootContentEvent.fire(this, this);




..into

RevealContentEvent.fire(this, IncludePresenter.TYPE_SetMainContent , this);




..pretty easy right? BUT that is still too much typing. Worry not! With the gwtp eclipse plugin, you can easily select the parent presenter and it will auto generate the code above for you! How awesome is that?!!

The plugin and video tutorial is available here: http://code.google.com/p/gwt-platform/wiki/EclipsePlugin

No comments:

Post a Comment