contrasting styles of web ui development: gwt vs native javascript
Post on 08-Jan-2016
37 Views
Preview:
DESCRIPTION
TRANSCRIPT
Contrasting styles of Web UI Development: GWT vs
Native JavaScript
Roland SchweitzerWeathertop Consulting, LLC
Jeremy Malczyk JISAO
GO-ESSP 2008 2
GWT development is like...
going to hear a symphony.
GO-ESSP 2008 3
JavaScript development is like...
going to have oral surgery.
GO-ESSP 2008 4
GO-ESSP 2008 5
GO-ESSP 2008 6
GO-ESSP 2008 7
IDE Tools
Special “hosted” browser that runs the native Java for development and testing in the IDE
Debug client and server in the same IDE Cross-compiler that compiles and optimized the
Java into JavaScript targeted to a suite of common browsers
Deploys as regular web page with JavaScript references on any Web server
GO-ESSP 2008 8
Extensive Widget Library
Many widgets (including maps) Widgets are easy to combine into reusable
composite widgets Listeners can “bubble up” clicks through the widget
stack so clicks can be handled at the top level
GO-ESSP 2008 9
Reuse Existing JavaScript
“Overlay” a Java type on existing JavaScript code Similar in concept to JNI in fact they call it JSNI
public class LASDateWidget extends JavaScriptObject {
protected LASDateWidget(){}
public final native String getDateLo()
/*-{ return this.getDateLo(); }-*/;
GO-ESSP 2008 10
Used Date Widgets
GO-ESSP 2008 11
Reuse or adapt AJAX RPC Consume existing XML or JSON server responses Build or adapt services to use GWT RPC
It was so easy, I adapted our services to use native RPC Once the serializable container was written I could use it
on both the server and the client Didn’t have to use native JavaScript that I am too
impatient to understand and didn’t have to parse the JSON into a new client-side object
GO-ESSP 2008 12
Leverage Existing LAS Capabilities
AJAX request/responses already available to discover data sets, variables, grids, operations and options
Needed to add a way to group “data sets” (a single netCDF file) into collections that and to identify the group as special (candidate for the TimeSeries) interface.
group_name = “Channel Islands – Santa Rosa” group_type=”time_series”
GO-ESSP 2008 13
Leverage...
Existing tool (with new group parameters) consumes THREDDS catalogs which have collected the netCDF files into logical groupings and returns LAS configuration XML
Existing operation and options for plotting time series
Can add more from existing operation as needed or add new operations
GO-ESSP 2008 14
Conclusion
GWT is more fun than oral surgery!
top related