Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Gwt Presentation
1. GW T
A 'n e w ' w a y t o p r o g r a m d y n a m ic w e b a p p lic a t io n s
-U s m a n
-P a v a n
- R a ja k u m a r
2. Agenda
Overview of AJAX development
Problems with AJAX
What is GWT ?
Why GWT ?
Sample application
User Interface with GWT
RPC
Cons
3. C la s s ic w e b a p p lic a t io n m o d e l
( yn ch ro n o u s)
s
4. A ja x w e b a p p lic a t io n m o d e l
( syn ch ro n o u s)
a
5. A s y n c h r o n o u s Ja v a S c r ip t a n d X M L
( JAClient – side
A X) Server - side
Javascript JAVA
+ no page transition, no blocking + eclipse: debugging, easy
development
- No IDE
- good IDE’s
- Debugging is difficult
- Debugging is easy
- weakly typed
- strongly typed
6. A JA X
Asynchronous JavaScript and XML.
Clientside javascript to asynchronously fetch
the data
Using the DOM API dynamically modify the
page
Based on javascript,html,xml,css.xhtml,DOM.
Web browser UI to be more interactive and to
respond quickly to inputs
7. D ra w b a ck s
Multiple languages and framework across
stack
Mixing the js,jsp,xml,java leads maintenance
problem
Less modularization
Less reusable code
Breaks MVC principle.
Complicated debugging and testing with
different browsers.
Browsers back button and history maintains
problem
OOPS
8. W h a t is G W T ?
A FrameWork for building highly perfomant, Ajax
enabled , Javascript front-end web applications .
Provides Java-to-javaScirpt Compiler .
Allow to use the java development tools like
netbeans and eclipse.
Shell to test and debug modules without compilation
Simple asynchronous browser-to-server RPC
9. Why GWT ?
Rich user Interface
Open source
No need to learn Javascript language
No need to learn DOM Api( use java Api)
No plugIns required in client side
Junit integration
10. Why GWT ? (Cont ... )
OOPS
Asynchronous Calls
To share load between client and server
Keeping only insensitive data on client side
Not for validation but for the better and rich user
interface.
11. G W T A p p lic a t io n A r c h it e c t u r e
12. M o d e s o f R u n n in g G w t a p p lic a t io n
Gwt Application can run in two modes .
Host Mode
Hosted Mode is a 'simulated' mode
Run entirely from Eclipse using the GWT Shell.
* Consists of a customized Tomcat Web container.
* Makes debugging easier .
Web Mode
Run as pure JavaScript and HTML,compiled from
your original Java source code with the GWT
13. G o o g le W e b To o lk it ( W T)
G
@ development time @ deployment time
Compile to
JAVA/eclipse
<html>
Javascript
javascript
[...]
<script type=quot;text/javascriptquot;>
[...]
xmlhttp.open(quot;POSTquot;, url, true);
xmlhttp.onreadystatechange = function(func) {
if (xmlhttp.readyState == 4) {
[...]
}
}
xmlhttp.setRequestHeader('MessageType', 'CALL');
xmlhttp.setRequestHeader('Content-Type', 'text/xml');
e </script>
<body>[...]</body>
cod
</html>
A b ile t o
yte
JAV omp
C
Hosted mode
JVM
IDE
14. G W T: p r o je c t s t r u c t u r e
Package Purpose
it/sella/gwt/ The project root
package contains
module XML files
it/sella/gwt/client/ Client-side source files
and subpackages
it/sella/gwt/server/ Server-side code and
subpackages
it/sella/gwt/public/ Static resources that can
be served publicly
15. G W T M o d u le s
*.gwt.xml
Jsp,Html, ...
Entry point class (java class)
Css , Images ,other xmls …
External java script file
17. G W T- P C
R
These are Asynchronous Calls.
A framework used to exchange java objects .
Based on the java servlet architecture .
GWT handle the serialization of java objects.
GWT-RPC services are not same as web
services . .
19. Co rn s o f GW T
Browser compatibility pretty good but issues
with some browsers.
Although java to javascript convertion takes
place, not all features of java can be
implemented .eg multi threading,Calender etc
Gwt generated javascript and html are very
difficult to understand .
Layouts,panels and some widgets have bugs .
20. C o r n s o f G W T ( C o n t ... )
The appearance of the application depends
on the browser.
Take long time to load and heavily uses the
client resources.
21. R e fe re n ce
Documentation & Tutorial :
http://code.google.com/webtoolkit/
http://code.google.com/webtoolkit/tutorials/1.6/ind
Libraries
http://gwt-ext.com/
http://extjs.com/products/gxt/
Showcase
http://gwt.google.com/samples/Showcase/Showc
http://www.gwt-ext.com/demo/#credits