200804_devhive_gwt.ppt

35
1 MIKE BURBA FOUNDER Google Web Toolkit APRIL 17 TH , 2008

Upload: sampetruda

Post on 26-Jan-2015

103 views

Category:

Documents


0 download

DESCRIPTION

 

TRANSCRIPT

Page 1: 200804_DevHive_GWT.ppt

1

MIKE BURBAFOUNDER

Google Web ToolkitAPRIL 17TH, 2008

Page 2: 200804_DevHive_GWT.ppt

2

Acknowledgements

Portions of this presentation were borrowed with permission from the following presentations:

• Bruce Johnson, GWT Tech Lead, Google– Fast, Easy, Beautiful: Pick Three - Building User

Interfaces with GWT– Writing Big Apps with GWThttp://code.google.com/webtoolkit/presentations.html

• Didier Girard, CTO, SFEIR– Introduction to the Google Web Toolkit http://www.slideshare.net/dgirard/introduction-to-google-web-toolkit?src

=embed

Page 3: 200804_DevHive_GWT.ppt

3

DevHive is a SaaS platform for custom business apps

• Platform-as-a-Service

• Business app building blocks

• Software marketplace

Page 4: 200804_DevHive_GWT.ppt

4

Demonstration

Page 5: 200804_DevHive_GWT.ppt

5

Why Ajax?

Page 6: 200804_DevHive_GWT.ppt

6

At first, Ajax is really cool

SO

UR

CE

: D

idie

r G

irar

d

Page 7: 200804_DevHive_GWT.ppt

7

SO

UR

CE

: D

idie

r G

irar

d

But, what about…

• … cross-browser• … memory leaks• … loading latency• … Javascript PhD• … Ajax IDE • … bugs (javascript is a dynamic language)• … cross browser javascript debugger• … security• …

Page 8: 200804_DevHive_GWT.ppt

8

The Solution: GWT

• Build Ajax apps with Java• Developers with Java

skills• Tool support: IDEs,

debugger, JUnit, etc. • Eliminate browser-

specific coding• Facilitate reuse• Fast, simple RPC

SOURCE: Bruce Johnson

Page 9: 200804_DevHive_GWT.ppt

9

BrowserIE, Firefox, Safari, Opera

BrowserIE, Firefox, Safari, Opera

Java Runtime LibraryJava Runtime Library

How it works

java.langjava.lang

java.utiljava.util

Java.ioJava.io

Application code

GWT GUI LibraryGWT GUI Library

Panels

PopupStack

AbsoluteVertical

WidgetsButton MenuBar

Radio TreeCheck Table

TextArea ….

Javascript Application

GWT Runtime100Ko

GWTCompiler

GWTCompiler

SO

UR

CE

: D

idie

r G

irar

d

Page 10: 200804_DevHive_GWT.ppt

10

HelloWorld

SO

UR

CE

: D

idie

r G

irar

d

Page 11: 200804_DevHive_GWT.ppt

11

Robust API

SO

UR

CE

: B

ruce

Jo

hn

son

Page 12: 200804_DevHive_GWT.ppt

12

Widgets : 100% Java

SO

UR

CE

: D

idie

r G

irar

d

Page 13: 200804_DevHive_GWT.ppt

13

History support

SO

UR

CE

: B

ruce

Jo

hn

son

Page 14: 200804_DevHive_GWT.ppt

14

RPC Support

SO

UR

CE

: D

idie

r G

irar

d

Page 15: 200804_DevHive_GWT.ppt

15

Cross browser, cross platform

SOURCE: Didier Girard

Page 16: 200804_DevHive_GWT.ppt

16

CSS

• GWT widgets are CSS compatible

SOURCE: Didier Girard

Page 17: 200804_DevHive_GWT.ppt

17

Debugger

SOURCE: Didier Girard

Page 18: 200804_DevHive_GWT.ppt

18

Javascript integration

• JSNI is modelled on JNI

• Many javascript library are already wrapped : Dojo, Extjs, Google Ajax API…

public static native void alert(String msg) /*-{ $wnd.alert(msg); }-*/;

SOURCE: Didier Girard

Page 19: 200804_DevHive_GWT.ppt

19

Compiler optimizations

SO

UR

CE

: B

ruce

Jo

hn

son

Page 20: 200804_DevHive_GWT.ppt

20

Tools

• GWT is supported by all the Java IDEs: Eclipse, NetBeans, IntelliJ IDEA, JDeveloper,…

Page 21: 200804_DevHive_GWT.ppt

21

Open Source

Page 22: 200804_DevHive_GWT.ppt

22

GWT : The Community

• Millions of downloads

• 11,000 subscribers to the forum

• Books

• Tons of tutorials

• Blogs

SO

UR

CE

: D

idie

r G

irar

d

Page 23: 200804_DevHive_GWT.ppt

23

How easy do you find GWT to use ?

23 Google Confidential

Source : http://www.ongwt.com/post/2008/02/21/How-easy-do-you-find-GWT-to-use

SO

UR

CE

: D

idie

r G

irar

d

Page 24: 200804_DevHive_GWT.ppt

24

Resources

GWT :http://code.google.com/webtoolkit/

Forum :http://groups.google.com/group/Google-Web-Toolkit

GWT Blog : http://googlewebtoolkit.blogspot.com/

onGWT, Tracking news on GWT : http://www.ongwt.com/

Page 25: 200804_DevHive_GWT.ppt

25

Lessons Learned

Page 26: 200804_DevHive_GWT.ppt

26

Design your apps for the real world

Real-world users…• Have dial-up• Click things furiously

when they don’t see the screen respond

• Don’t find your app as “elegant” & “intuitive” as you do

• They hit the back button

• Multi-task

Page 27: 200804_DevHive_GWT.ppt

27

Think asynch

• Handle exceptions!

• Tell the user that something is going on

• Load pages incrementally

• Gracefully deal with stale sessions

Page 28: 200804_DevHive_GWT.ppt

28

Working with adesigner

• It’s ok to use more than one HTML page

• Have the designerprepare HTML / CSS

• Drop GWT elements onthe page as required

Page 29: 200804_DevHive_GWT.ppt

29

Optimizing deployment

• Use ant

• Include only the files that are needed in production

• Compress static content (Gzip – ant task) – 25% improvement

• Tell browser to cache (far future headers) – 10X improvement

Page 30: 200804_DevHive_GWT.ppt

30

One GWT module peruser “role”

Manager.gwt.xml171k

Admin.gwt.xml512k

User.gwt.xml323k

Page 31: 200804_DevHive_GWT.ppt

31

Use Model-View-Controller

Controller

Model

Page 32: 200804_DevHive_GWT.ppt

32

During development, compilefor only one browser

SOURCE: Didier Girard

*

*Hosted mode currently uses IE. Once GWT 1.5 ships, you should be able to stick to FF

Page 33: 200804_DevHive_GWT.ppt

33

Get Firebug

Page 34: 200804_DevHive_GWT.ppt

34

[Eclipse] project layout

• Single Java project

• Manually setup JEE Web folders– One folder for static

content you want to cache

• Separate folders for – Client– Server– Common / shared classes

Page 35: 200804_DevHive_GWT.ppt

35

Contact info

[email protected]

+1.248.207.5054