Professional Documents
Culture Documents
Ext GWT - Overview and Implementation Case Study
Ext GWT - Overview and Implementation Case Study
2007 GWT
r y,E xt-js
OJO,jQue
D
• RPC Paradigm
• Development mode
GWT Compiler Java 2 javascript (1)
• highly optimized . . .
– in-lining methods
2 1 3
1
2
3
RPC Paradigm (3)
Full IDE SUpport
Development
• Easy to debug
– No need to open firebug or IE developer tool
– Run, build, debug, and test all in Java
• Strongly typed
– Coding time typos
• Code compilation
– Generics .
• Java tools
– Static testing tools – find Bug
• i18n
Conclusions
• Scalable UI framework
• JAVA – reasonable learning curve, fits to agile Developments
environments
• Easy to debug – use Firebug only on specific missions
• Easy to Test
?
Demo
GWT Vs GXT - Forms
GWT GXT
Best Practice
Web application folder
Java code that compiles to java script
• Step 2
– Copying GXT resources to the WAR
directory
Integration GXT – 4 Steps (2)
• Step 3
– Adding reference in the *.html file
Integration GXT – 4 Steps (3)
• Step 4
– Adding GXT reference in the *.gwt.xml file
MVC N-Tier- Class Diagram
MVC – Folder Structure
VIEW
MODEL
CONTROLLER
MVC
MVC – Application Events
• Lets define an application event
• Any Controller can register to any event and get notifications from the event bus
VIEW
MODEL
CONTROLLER
CONTROLLER
MVC – Controller
MVC
• Responsible for the communication with the server
• Any Controller that is interested in an event, can register it
@Override
public void handleEvent(AppEvent event) {
}
VIEW
MODEL
CONTROLLER
MVC – View
• The View – responsible placing widget in the Layout
MVC
• The glue between the server and the widget
@Override
protected void handleEvent(AppEvent event) {
EventType eventType = event.getType();
if (eventType.equals(BoziaApplicationEvents.SEARCH_EXECUTED)) {
// render a widget
myDashboardWidget.render();
}
}
MVC – The Trigger
public MyDemoWidget() {
Button searchBtn = new Button("Search");
searchBtn.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
EventType SEARCH_EXECUTED = new EventType();
AppEvent mySearchEvent = new AppEvent(BoziaApplicationEvents.SEARCH_EXECUTED);
mySearchEvent.setData("user_info", "Avi Perez click this btn");
Dispatcher.get().dispatch(mySearchEvent);}
});
}
MVC – last thing….
Dispatcher – The event bus
}
MVC – Demo
Good to know…(1)
• Exception
– No Need for try{} catch{} clause
– Just state the throws – automatically will be
navigated to the onFaliure(Throwable t){}
Good to know…(2)
• MONITORING
Good to know…(3)
• Command Pattern RPC
– Single server access point
– Better handling exceptions
– Recommended by Google team
Web Application Demo