gwt presentation

21
GWT A 'n e w ' w ay to p ro g ra m d yn a m ic w e b applications -Usm an -Pavan -Rajakumar

Upload: rajakumartu

Post on 04-Jul-2015

3.335 views

Category:

Technology


1 download

DESCRIPTION

This is the Introduction to GWT .

TRANSCRIPT

Page 1: Gwt Presentation

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 l i c a t i o n s

- U sm a n- P a v a n

- R a ja k u m a r

Page 2: Gwt Presentation

Overview of AJAX development Problems with AJAX What is GWT ? Why GWT ? Sample application User Interface with GWT RPC Cons

A g e n d a

Page 3: Gwt Presentation

C la s s i c w e b a p p l i c a t i o n m o d e l

(s y n c h r o n o u s)

Page 4: Gwt Presentation

A ja x w e b a p p l i c a t i o n m o d e l

(a s y n c h r o n o u s)

Page 5: Gwt Presentation

Server - sideClient – side

Javascript JAVA

+ no page transition, no blocking- No IDE- Debugging is difficult- weakly typed

+ eclipse: debugging, easy development- good IDE’s- Debugging is easy- strongly typed

A s y n c h r o n o u s Ja v a S c r i p t a n d XM L

(A JA X)

Page 6: Gwt Presentation

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

Page 7: Gwt Presentation

D r a w b a c k 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

Page 8: Gwt Presentation

W h a t i s GW 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

Page 9: Gwt Presentation

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

Page 10: Gwt Presentation

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.

Page 11: Gwt Presentation

GW T A p p l i c a t i o n A r c h i t e c t u r e

Page 12: Gwt Presentation

M o d e s o f R u n n in g Gw t a p p l i c a t i o 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

Page 13: Gwt Presentation

Go o g l e W e b To o l k i t (GW T)@ deployment time@ development time

<html>[...]<script type="text/javascript">[...]xmlhttp.open("POST", url, true);xmlhttp.onreadystatechange = function(func) { if (xmlhttp.readyState == 4) { [...] }}xmlhttp.setRequestHeader('MessageType', 'CALL');xmlhttp.setRequestHeader('Content-Type', 'text/xml');</script><body>[...]</body></html>

JAVA

/ecl

ipse

java

scrip

t

Hosted modeJVMIDE

Com

pile

to J

AVA

byte

code

Compile toJavascript

Page 14: Gwt Presentation

GW T: p r o j e c t s t r u c t u r ePackage Purposeit/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

Page 15: Gwt Presentation

GW T M o d u le s

*.gwt.xml

Jsp,Html, ...

Entry point class (java class)

Css , Images ,other xmls …

External java script file

Page 16: Gwt Presentation

U I w id g e t l i b r a r y

Page 17: Gwt Presentation

GW T-R P C

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 . .

Page 18: Gwt Presentation

R P C p lu m b in g d i a g r a m

Page 19: Gwt Presentation

Co r n 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 .

Page 20: Gwt Presentation

Co r n s o f GW T ( Co n t ... )

The appearance of the application depends on the browser.

Take long time to load and heavily uses the client resources.

Page 21: Gwt Presentation

R e f e r e n c eDocumentation & Tutorial :

http://code.google.com/webtoolkit/ http://code.google.com/webtoolkit/tutorials/1.6/index.html Libraries http://gwt-ext.com/ http://extjs.com/products/gxt/ Showcase http://gwt.google.com/samples/Showcase/Showcase.html http://www.gwt-ext.com/demo/#credits