Wednesday, December 2, 2009

Story of IHG GWT - Architecture - Code Reuse

For the page with form input, we create pattern with following components:
  • formEntry, define all form entities, like firstName, lastName text boxes. The responsible is to fill the object to widget as well as to get value from widget, handle click or other event, call RPC etc.
  • displayWidget, responsible for putting form entity such as firstName to the correct location.
  • validate responsible for validating the form input.
  • view, which is defined in the config xml file, is the starting point to tie formEntry and dispalyWidget together.
Benefit of the pattern:
  • to separate developer responsibilities, UI (CSS) developer is able to only deal with displayWidget to display the page as required. While Java developer only works on formEntry/Validation with business logic.
  • to easily change the layout of the component. For example, in the attached graphic for form section, three different layouts of quick search form are required, the function is the same. By providing different displayWidget, it is easy to change the layout.




Page views:
http://www.holidayinn.com/hotels/us/en/atlib/hoteldetail
http://www.holidayinn.com/hotels/us/en/atlib/hoteldetail#Directions
http://www.holidayinn.com/hotels/us/en/atlib/hoteldetail#Hotel-Room-Rates

Change History:
Author:
Michael Wang, initial draft

No comments:

Post a Comment