• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content

Loading…

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

Like this presentation? Why not share!

Google Developer Day 2010 Japan: 製品レベルの GWT アプリケーション - Google での設計手法 (フレッド ソオー)

on

  • 1,669 views

大規模な GWT アプリケーションでは、プロジェクトの初期から考慮すべきことが山ほどあります。GWT ...

大規模な GWT アプリケーションでは、プロジェクトの初期から考慮すべきことが山ほどあります。GWT には幾多の便利なテクノロジーが詰まっていますが、すべてをまとまった形で使いこなすのは難しいものです。このセッションでは Google の開発チームが、どのように製品レベルの GWT アプリケーションを設計しているのかを解説します。

Statistics

Views

Total Views
1,669
Views on SlideShare
1,261
Embed Views
408

Actions

Likes
0
Downloads
11
Comments
0

9 Embeds 408

http://googledevjp.blogspot.com 341
http://googledevjp.blogspot.jp 57
http://static.slidesharecdn.com 3
http://googledevjp.blogspot.de 2
http://googledevjp.blogspot.nl 1
http://googledevjp.blogspot.com.es 1
http://googledevjp.blogspot.ru 1
http://googledevjp.blogspot.ca 1
http://googledevjp.blogspot.in 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Google Developer Day 2010 Japan: 製品レベルの GWT アプリケーション - Google での設計手法 (フレッド ソオー) Google Developer Day 2010 Japan: 製品レベルの GWT アプリケーション - Google での設計手法 (フレッド ソオー) Presentation Transcript

    • Google Developer Day 2010 Monday, September 27, 2010
    • Architecting GWT applications for production at Google Fred Sauer Tokyo, September 28, 2010 Google Developer Day 2010 Monday, September 27, 2010
    • Answering two questions • How does Google architect its web apps? • How are GWT 2.1 and Spring Roo going to help me do the same? – com.google.gwt.app – com.google.gwt.requestfactory 3 Google Developer Day 2010 Monday, September 27, 2010
    • If you like this talk, you’ll love… Building on last year’s Best Practices for Architecting http://code.google.com/events/io/2009/sessions/GoogleWebToolkitBestPractices.html Model Presenter View 4 Google Developer Day 2010 Monday, September 27, 2010
    • Production Ready Google Developer Day 2010 Monday, September 27, 2010
    • “Production ready” means… • Well tested • Secure • Monitored – What’s broke – What’s slow • Scalable – Lots of users – Lots of developers • Bookmark friendly • Crawlable • Localized 6 Google Developer Day 2010 Monday, September 27, 2010
    • Isolation • Well tested ✔ • Secure • Monitored – What’s broke – What’s slow • Scalable ✔ – Lots of users ✔ – Lots of developers ✔ • Bookmark friendly ✔ • Crawlable ✔ • Localized 7 Google Developer Day 2010 Monday, September 27, 2010
    • Instrumentation • Well tested ✔ • Secure • Monitored ✔ – What’s broke ✔ – What’s slow ✔ • Scalable ✔ – Lots of users ✔ – Lots of developers ✔ • Bookmark friendly ✔ • Crawlable ✔ • Localized 8 Google Developer Day 2010 Monday, September 27, 2010
    • Suspicion • Well tested ✔ • Secure ✔ • Monitored ✔ – What’s broke ✔ – What’s slow ✔ • Scalable ✔ – Lots of users ✔ – Lots of developers ✔ • Bookmark friendly ✔ • Crawlable ✔ • Localized 9 Google Developer Day 2010 Monday, September 27, 2010
    • Discussed at Google I/O • Well tested ✔ • Secure ✔ • Monitored ✔ – What’s broke ✔ – What’s slow ✔ • Scalable ✔ – Lots of users ✔ – Lots of developers ✔ • Bookmark friendly ✔ GWT's UI overhaul • Crawlable ✔ http://bit.ly/io2010-gwt5 • Localized ✔ 10 Google Developer Day 2010 Monday, September 27, 2010
    • Isolation Google Developer Day 2010 Monday, September 27, 2010
    • MVP Model Presenter Effective Testing Daniel Danilatos… View http://bit.ly/io2010-gwt7 12 Google Developer Day 2010 Monday, September 27, 2010
    • MVP Model DTO Presenter Effective Testing Daniel Danilatos… View http://bit.ly/io2010-gwt7 12 Google Developer Day 2010 Monday, September 27, 2010
    • Waaah, DTOs violate DRY* DTO XHR DTO Presenter Domain Obj View *DRY = Do not Repeat Yourself 13 Google Developer Day 2010 Monday, September 27, 2010
    • Repetition via tools ! ! DTO XHR DTO Presenter Domain Obj Request Factory Servlet View 14 Google Developer Day 2010 Monday, September 27, 2010
    • cRud (=Read) Employee ! Request Request ! RF Presenter JSON Factory Servlet Employee ! Employee Record View 15 Google Developer Day 2010 Monday, September 27, 2010
    • CrUD (=Create, Update, Delete) Sync Employee ! Request Record Request ! RF Presenter JSON Factory Servlet Employee ! Employee Changed View Event Bus 16 Google Developer Day 2010 Monday, September 27, 2010
    • Waaah, presenter is too much boilerplate ! DTO Presenter View 17 Google Developer Day 2010 Monday, September 27, 2010
    • Waaah, presenter is too much boilerplate ! DTO ! Activity Presenter View 17 Google Developer Day 2010 Monday, September 27, 2010
    • Activity life cycle Event Bus ! Place Change Event Activity onStop() Activity Manager start() ! Request ! Activity XHR showWidget() Factory 18 Google Developer Day 2010 Monday, September 27, 2010
    • Activity in test start() ! Mock AM Activity Mock RF showWidget() 19 Google Developer Day 2010 Monday, September 27, 2010
    • Isolated activity is crawlable activity • Activity life cycle tied to history changes • History changes tied to discrete URLs — bookmarkable – http://example.com/#report:123456 • Add a bang and a headless server — crawlable – http://example.com/#!report:123456 • http://code.google.com/web/ajaxcrawling/docs/getting-started.html 20 Google Developer Day 2010 Monday, September 27, 2010
    • Waaah, too boring to test is too boring to write ! DTO ! Activity Presenter View 21 Google Developer Day 2010 Monday, September 27, 2010
    • Waaah, too boring to test is too boring to write ! DTO ! Activity Presenter Editor ! View Support 21 Google Developer Day 2010 Monday, September 27, 2010
    • Selections of EditView<EmployeeRecord> private static final EditorSupport SUPPORT = GWT.create(EditorSupport.class); @UiField TextBox displayName; @UiField TextBox userName; public void setValue(EmployeeRecord value) { this.record = value; SUPPORT.setValue(this, value); } public boolean isChanged() { return SUPPORT.isChanged(this); } 22 Google Developer Day 2010 Monday, September 27, 2010
    • All isolation promises kept but one • Well tested ✔ • Secure • Monitored – What’s broke – What’s slow • Scalable ✔ – Lots of users ✔ – Lots of developers ✔ • Bookmark friendly ✔ • Crawlable ✔ • Localized 23 Google Developer Day 2010 Monday, September 27, 2010
    • Give me convenience or give me scale JPA-- Super portable No reference fields (No joins) Super scalable Anywhere but GAE JPA for real Scalable enough 24 Google Developer Day 2010 Monday, September 27, 2010
    • Instrumentation Google Developer Day 2010 Monday, September 27, 2010
    • Your eyes on the browser • Logging • Stack traces • User Actions 26 Google Developer Day 2010 Monday, September 27, 2010
    • Logging: phone home • Client side logger with remote logging service – http://code.google.com/p/gwt-log/ GWT *.* – java.util.logging in GWT 2.1 • Accumulate logs client side • Watch for request batches and ride along, or flush on timer 27 Google Developer Day 2010 Monday, September 27, 2010
    • Stack Traces • Method level for free on most modern browsers • Get it to the server – HttpThrowableReporter to send JSON formatted via XHR – In gwt-log, use RemoteLoggerService • Re-symbolize obfuscated traces server side – http://code.google.com/p/google-web-toolkit/wiki/WebModeExceptions – Fair warning: that page is terse to the point of encryption 28 Google Developer Day 2010 Monday, September 27, 2010
    • Emulated Stack Traces • For line-level traces – and anything at all on less modern browsers <set-property name="compiler.emulatedStack" value="true" /> <set-configuration-property name="compiler.recordLineNumbers" value="true" /> <set-configuration-property name="compiler.recordFileNames" value="true" /> • But your app is fatter and slower 29 Google Developer Day 2010 Monday, September 27, 2010
    • Emulated stack traces in production Let your uses opt in (using gwt-log) <!-- gwt-log logging is `OFF` by default --> <inherits name="com.allen_sauer.gwt.log.gwt-log-OFF" /> <!-- also compile your application at `INFO` level --> <extend-property name="log_level" values="INFO"/> Provide link to your users to enable logging: http[s]://hostame:port/path/to/Module.html?log_level=INFO 30 Google Developer Day 2010 Monday, September 27, 2010
    • User Actions • Unique strings associated with each interesting UI element – links, buttons – maybe in ui.xml • User gestures (clicks a link, say), User Action event posted on Event Bus – Time is noted – RPCs queued in this event loop are attributed to this Action • When all RPCs return, time is tallied, logs trickle to server • Planned for GWT 2.1 31 Google Developer Day 2010 Monday, September 27, 2010
    • Suspicion Google Developer Day 2010 Monday, September 27, 2010
    • Secure: guard against cross site scripting attacks • RemoteServiceServlet watching for X-GWT-Permutation header for XSRF paranoia – New in GWT 2.1 – Only XHR can set a header, and XHR is from your domain • SafeHTML – Debuts as open source in new web-based Wave FedOne client – http://code.google.com/p/wave-protocol/ – Destined for GWT 2.<something> 33 Google Developer Day 2010 Monday, September 27, 2010
    • SafeHtml: because setHtml() isn’t • If the user typed it, you must not render it as HTML – prefer HasText#setText to HasHTML#setHTML – prefer Element#setInnerText to Element#setInnerHTML • SafeHtml interface promises its asString() produces harmless HTML • SafeHtmlBuilder and SimpleHtmlSanitizer • for assembling untrusted strings into SafeHtml instances • SafeHtml aware widgets that replace setHTML() with setSafeHtml() 34 Google Developer Day 2010 Monday, September 27, 2010
    • Recap Google Developer Day 2010 Monday, September 27, 2010
    • “Production ready” means… • Well tested • Secure • Monitored – What’s broke – What’s slow • Scalable – Lots of users – Lots of developers • Bookmark friendly • Crawlable 36 Google Developer Day 2010 Monday, September 27, 2010
    • “Production ready” means… • Well tested ✔ • Be isolated • Secure • Monitored – What’s broke – What’s slow • Scalable ✔ – Lots of users ✔ – Lots of developers ✔ • Bookmark friendly ✔ • Crawlable ✔ 37 Google Developer Day 2010 Monday, September 27, 2010
    • “Production ready” means… • Well tested ✔ • Be isolated • Secure • Be instrumented • Monitored ✔ – What’s broke ✔ – What’s slow ✔ • Scalable ✔ – Lots of users ✔ – Lots of developers ✔ • Bookmark friendly ✔ • Crawlable ✔ 38 Google Developer Day 2010 Monday, September 27, 2010
    • “Production ready” means… • Well tested ✔ • Be isolated • Secure ✔ • Be instrumented • Monitored ✔ • Be suspicious – What’s broke ✔ – What’s slow ✔ • Scalable ✔ – Lots of users ✔ – Lots of developers ✔ • Bookmark friendly ✔ • Crawlable ✔ 39 Google Developer Day 2010 Monday, September 27, 2010
    • Don’t work so hard Model Presenter View 40 Google Developer Day 2010 Monday, September 27, 2010
    • Don’t work so hard ! DTO ! Activity Presenter Editor ! View Support 40 Google Developer Day 2010 Monday, September 27, 2010
    • Google Developer Day 2010 Monday, September 27, 2010