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.

RAP vs GWT Which AJAX Technology is for you?


Published on

Published in: Technology
1 Comment
No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

RAP vs GWT Which AJAX Technology is for you?

  1. 1. RAP vs GWT Which AJAX technology is for you? by Mark Russell
  2. 2. Overview <ul><li>Introduction </li></ul><ul><ul><li>Who we are </li></ul></ul><ul><li>Demo </li></ul><ul><ul><li>Example apps, UI elements, Styles and Graphing </li></ul></ul><ul><li>Development </li></ul><ul><ul><li>Architecture and Debugging </li></ul></ul><ul><li>Communication </li></ul><ul><ul><li>Browser interaction and RPC </li></ul></ul><ul><li>Build and Deployment </li></ul><ul><ul><li>Automation, process and server infrastructure </li></ul></ul><ul><li>Performance </li></ul><ul><ul><li>Measuring and tuning hosted apps </li></ul></ul><ul><li>Unit Testing </li></ul><ul><ul><li>Development and performance comparison </li></ul></ul><ul><li>Summary </li></ul>
  3. 3. Introduction <ul><li>Mark Russell </li></ul><ul><ul><li>Co-architect of the Instantiations continuous build and deployment system </li></ul></ul><ul><ul><li>Build master with 14 years experience developing large and small build systems for large corporate systems and small open source projects </li></ul></ul><ul><ul><li>Developer on several Instantiations products such as CodePro and RCPDeveloper </li></ul></ul><ul><ul><li>Eclipse committer </li></ul></ul>
  4. 4. <ul><li>Founded in 1997, Headquarters in Portland, OR </li></ul><ul><li>Market leading tools </li></ul><ul><ul><li>Automated Software Quality </li></ul></ul><ul><ul><li>UI Construction and Testing Tools </li></ul></ul><ul><li>CodeGear division of Embarcadero OEM’ed Swing Designer for JBuilder® 2008 </li></ul><ul><li>8 years of extensive Eclipse experience Active Eclipse Foundation member and major contributor. </li></ul><ul><li>Customer focused. Customer driven. </li></ul>
  5. 5. Awards and Acknowledgements “ WindowBuilder delivers the kind of GUI building productivity that we use to have before we converted to Java.” Sally Rich Checkfree Solutions 2006 - 2008 Private 100 Fastest Growing Oregon Companies “ RCP Developer is the first product to bring comprehensive application construction, GUI testing and packaging of rich-client applications to Eclipse RCP. We are delighted that Instantiations is delivering this important technology to the growing Eclipse ecosystem.” Mike Milinkovich, Executive Director Eclipse Foundation #14 Fastest Growing Technology Company 2006 “ Since we started using WindowTester, tests that took 2–3 weeks to write previously can now be done in 2–3 days.” Steve Tocco Director of Quality Assurance, BEA “ Because our software is used to drive key business decisions, it's critical that we deliver high-quality software, and implementing CodePro AnalytiX has allowed us to automate the process of enforcing programming standards and best practices.” Rich Main, Director, Java Development Environments, SAS
  6. 6. Strategic Product Lines Automated Software Quality Tools for Code Analysis, Measurement and Improvement Automated testing of Java GUIs for SWT and Swing WYSIWYG development of Java GUIs for SWT, Swing and GWT Finalist
  7. 7. Professional Services <ul><li>One of the most experienced teams of Eclipse, Java and Smalltalk experts </li></ul><ul><li>Planning assistance for build and deployment </li></ul><ul><li>QuickQuality live mentoring boot-camp </li></ul><ul><li>Architectural, design and development mentoring </li></ul><ul><li>Custom software engineering </li></ul>“ The members of the professional services team at Instantiations are truly top-tier technologists. Not only did they integrate right into our team, bringing impressive experience and mentoring skills to bear, they brought along enough big-picture aptitude to understand our business problems, our pressures, and what project success meant for us.” Jesse Watson Manager, Engineering Varolii Corporation
  8. 8. Similarities <ul><li>Rich browser based UI based on AJAX </li></ul><ul><li>Developers write Java code (not JavaScript) </li></ul><ul><li>… but that’s where the similarities end </li></ul>
  9. 9. Demo – RAP application in action <ul><li>Main “window” can be dragged within browser </li></ul><ul><li>Pull down menus </li></ul><ul><li>Panels are resizable within main window </li></ul><ul><li>Popup “windows” restricted to browser content area </li></ul>Looks and feels like an Eclipse application embedded in a browser
  10. 10. RAP – UI Components <ul><li>Most SWT widgets have RWT * counterparts, except: </li></ul><ul><li>StyledText (under investigation) </li></ul><ul><li>FormText </li></ul><ul><li>GC (often used with custom widgets… under investigation) </li></ul><ul><li>Much of JFace is implemented such as tables, content and label providers, actions, contributions, wizard framework, many dialogs, layouts, colors, fonts, etc. </li></ul><ul><li>Also </li></ul><ul><li>Drag and drop (planned) </li></ul><ul><li>Custom Widgets are possible </li></ul>* RWT = RAP Widget Toolkit
  11. 11. RAP – Styles <ul><li>Now supports CSS files (June 2008) </li></ul>* { backgound-color: white; } Button[PUSH], Button[TOGGLE] { border: 2px solid blue; color: rgb( 17, 23, 103 ); background-color: #f9f9f9; } Button[PUSH]:hover, Button[TOGGLE]:hover { background-color: white; } http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse.rap.help/help/html/intro.html > RAP Developer Guide > Advanced Topics > RWT Theming (CSS in the future)
  12. 12. RAP – Supported Browsers <ul><li>Wrappers the Qooxdoo JavaScript library, supporting the same set of browsers… </li></ul><ul><li>Microsoft IE 5.5 + ( decent performance with 7.0 + ) </li></ul><ul><li>Firefox 1.0 + </li></ul><ul><li>Opera 8 + </li></ul><ul><li>Any Gecko-based browser with Gecko 1.7 + </li></ul><ul><li>Safari 2.0 (limited support) </li></ul><ul><li>Safari 3.0 </li></ul>http://qooxdoo.org/documentation/0.7/requirements
  13. 13. Demo – GWT / Ext GWT application in action <ul><li>Main “window” fixed within browser </li></ul><ul><li>Pull down menus </li></ul><ul><li>Panels are resizable within main window </li></ul><ul><li>Popup “windows” restricted to browser content area </li></ul>MyGWT  Ext GWT
  14. 14. GWT – UI Components <ul><li>GWT </li></ul><ul><li>CheckBox and several types of buttons </li></ul><ul><li>Several types of text based fields including SuggestBox </li></ul><ul><li>List, Table, Tree, TabBar, Hyperlink </li></ul><ul><li>MenuBar, DialogBox and various panels </li></ul><ul><li>Custom widgets are possible </li></ul><ul><li>Call “raw” JavaScript using JavaScript Native Interface (JSNI) </li></ul>
  15. 15. GWT – API http://roberthanson.blogspot.com/2006/07/birds-eye-view-of-gwt-api.html
  16. 16. Ext GWT – UI Components <ul><li>Ext GWT </li></ul><ul><li>New layouts, tables, trees, windows, lists, menus, toolbars </li></ul><ul><li>Windows, dialogs, draggable, resizable, effects such as fade in fade out </li></ul><ul><li>Very integrated look and feel </li></ul>http://extjs.com/products/gxt/ MyGWT  Ext GWT
  17. 17. GWT – Styles <ul><li>Style based on standard CSS style sheets </li></ul><ul><li>Standard CSS provided for consistent look and feel </li></ul><ul><li>Can modify global styles for your app </li></ul><ul><li>Can extend or override on individual widget styles </li></ul><ul><ul><li>.mail-item-detail { </li></ul></ul><ul><ul><li>background-color : #E8EAEC; </li></ul></ul><ul><ul><li>border-bottom : 1px solid silver; </li></ul></ul><ul><ul><li>} </li></ul></ul><ul><ul><li>.mail-item-detail h1 { </li></ul></ul><ul><ul><li>font-weight : bold; </li></ul></ul><ul><ul><li>font-size : 14px; </li></ul></ul><ul><ul><li>padding : 5 0 2 5px; </li></ul></ul><ul><ul><li>} </li></ul></ul><ul><ul><li>.mail-item-detail h2 { </li></ul></ul><ul><ul><li>font-size : 12px; </li></ul></ul><ul><ul><li>font-weight : normal; </li></ul></ul><ul><ul><li>padding : 0 5 0 5px; </li></ul></ul><ul><ul><li>} </li></ul></ul>
  18. 18. GWT – Supported Browsers <ul><li>“ most recent versions of Internet Explorer, Firefox, and Safari. (Opera, too, most of the time.)” </li></ul><ul><li>Ext GWT (based on Ext JS – http://extjs.com/) </li></ul><ul><li>Internet Explorer 6+ </li></ul><ul><li>Firefox 1.5+ (PC, Mac) </li></ul><ul><li>Safari 2+ </li></ul><ul><li>Opera 9+ (PC, Mac) </li></ul>Ext GWT and Ext JS dual license license: 1) Open Source GNU GPL license v3 (free) 2) Commercial license ($$$) http://code.google.com/webtoolkit/documentation/com.google.gwt.doc.DeveloperGuide.Fundamentals.html#JavaRuntimeSupport
  19. 19. <ul><li>Widgets are great… but what about graphs? </li></ul><ul><li>Some options include: </li></ul><ul><li>Graphing widgets </li></ul><ul><li>Integrating “raw” JavaScript graphs </li></ul><ul><li>Graphing on the server for display on the client </li></ul>Graphing
  20. 20. GWT – Graphing Widgets <ul><li>GWT-Ext </li></ul><ul><li>An alternate add-on widget library for GWT </li></ul><ul><li>Similar to Ext GWT </li></ul><ul><li>Some graphing built in </li></ul>http://gwt-ext.com/demo/#chartGenerator
  21. 21. Integrating “raw” JavaScript graphs <ul><li>Many JavaScript (and Flash, PHP, …) graphing options, but you must integrate them yourselves </li></ul>http://www.smashingmagazine.com/2007/10/18/charts-and-graphs-modern-solutions/
  22. 22. Interactive graphs <ul><li>“Visio-like” interactive graphing </li></ul>http://www.mxgraph.com/demo.html
  23. 23. Graphing on the server <ul><li>Render graph on server using Java based graphics library (e.g. JFreeChart) into a file </li></ul><ul><li>Reference file in HTML page </li></ul>
  24. 24. History Management <ul><li>GWT provides functionality for programmatically adding state to the browser's back button history. </li></ul><ul><li>RAP does not currently have any framework for providing “browser back button” support. Qooxdoo offers functionality for browser back and browser history but RAP currently does not use those features. </li></ul><ul><li>This is an important feature missing from RAP… or is it? </li></ul>http://google-web-toolkit.googlecode.com/svn/javadoc/1.4/com/google/gwt/user/client/History.html
  25. 25. Development <ul><li>How do you develop applications with these frameworks? </li></ul>
  26. 26. RAP – Architecture <ul><li>Very similar to developing an RCP application </li></ul><ul><li>Can use UI development tools such as WindowBuilder Pro </li></ul>RAP RCP
  27. 27. RAP – Architecture <ul><li>Java code executed entirely on the server </li></ul><ul><li>Static JavaScript library deployed to client </li></ul>RAP RCP
  28. 28. <ul><li>One launch configuration for client and server </li></ul><ul><li> Port 8090 – makes it easy to serve up both RAP and GWT </li></ul>RAP – Debugging Internal Browser External Browser
  29. 29. GWT – Architecture <ul><li>Write Java code, some portion of which is compiled into JavaScript </li></ul><ul><li>Not all of the underlying </li></ul><ul><li>Java runtime library functionality </li></ul><ul><li>can be translated to JavaScript </li></ul><ul><li>syntax of Java regular expressions is similar, but not identical </li></ul><ul><li>long are mapped onto JavaScript double-precision floating point values </li></ul><ul><li>does not support subsequent dynamic loading of classes </li></ul><ul><li>does not support object finalization during garbage collection </li></ul><ul><li>Can use UI development tools such as GWT Designer </li></ul>http:// www.tml.tkk.fi/ Opinnot/T-111.5360/2007/ XForms/Overview.html
  30. 30. GWT – Debugging <ul><li>Launch server then GWT client in hosted mode. </li></ul><ul><li>Click “Compile/Browse” to launch in browser. </li></ul>OSGi Server Hosted Browser http/xml http/xml
  31. 31. Communication <ul><li>How do these frameworks communicate with the server? </li></ul>
  32. 32. RAP – Communication Layout Page Display Page Process Actions Render Changes Page Request Browser Server http://... mouse and key events mouse and key events Lookup Data Server-side representation of browser page update events
  33. 33. GWT – Communication Lookup Page Display Page Process Actions Render Changes Page Request Browser Server http://... Lookup Data XMLHttpRequest
  34. 34. GWT – Simplified RPC (XMLHttpRequest) <ul><li>IsSerializable (not java.io.Serializable) </li></ul><ul><ul><li>Java serialization relies on a few mechanisms that are not available in compiled JavaScript, such as dynamic class loading and reflection </li></ul></ul>http://code.google.com/support/bin/answer.py?answer=55196&topic=10210
  35. 35. GWT – Simplified RPC Example <ul><li>Client: (compiled to JavaScript) </li></ul><ul><li>public interface MailCommandsAsync { </li></ul><ul><li>public void getMailItems(AsyncCallback callback); </li></ul><ul><li>public void getMailItemBody(AsyncCallback callback); </li></ul><ul><li>} </li></ul><ul><li>instance = (…) GWT.create(MailCommands.class); </li></ul><ul><li>ServiceDefTarget target = (ServiceDefTarget) instance; </li></ul><ul><li>target.setServiceEntryPoint(... + &quot;MailCommands&quot;); </li></ul><ul><li>instance.getMailItems( </li></ul><ul><li>new AsyncCallback() { </li></ul><ul><li>public void onSuccess(Object result) { </li></ul><ul><li>List items = (List) result; </li></ul><ul><li>… display items … </li></ul><ul><li>} </li></ul><ul><li>public void onFailure(Throwable caught) { </li></ul><ul><li>… notify user of exception … </li></ul><ul><li>} </li></ul><ul><li>} </li></ul><ul><li>); </li></ul><ul><li>Server: </li></ul><ul><li>public interface MailCommands extends RemoteService { </li></ul><ul><li>public List getMailItems(); </li></ul><ul><li>public String getMailItemBody(); </li></ul><ul><li>} </li></ul><ul><li>public class MailCommandsImpl </li></ul><ul><li>extends RemoteServiceServlet </li></ul><ul><li>implements MailCommands </li></ul><ul><li>{ </li></ul><ul><li>public List getMailItems() { </li></ul><ul><li>… gather items </li></ul><ul><li>return items; </li></ul><ul><li>} </li></ul><ul><li>... etc … </li></ul><ul><li>} </li></ul>XMLHttpRequest
  36. 36. RAP and GWT – Communication <ul><li>RAP </li></ul><ul><li>Easy… no extra work… all communication is handled for you </li></ul><ul><li>GWT </li></ul><ul><li>More flexible… </li></ul><ul><ul><li>Optionally cache information on the client </li></ul></ul><ul><ul><li>Optionally pre-fetch information in background </li></ul></ul><ul><li>… but more work so what more is required for GWT ? </li></ul>
  37. 37. Build and Deployment <ul><li>How are apps built with these frameworks deployed? </li></ul>
  38. 38. Build Automation <ul><li>Scripted build process </li></ul><ul><li>Ant </li></ul><ul><li>Maven2 </li></ul><ul><li>Roll your own </li></ul><ul><li>Automation is a must </li></ul><ul><li>Manual process tends to be error prone over time </li></ul><ul><li>Scripted build process is very repeatable </li></ul><ul><li>Consider Continuous Integration </li></ul>
  39. 39. RAP – Plug-in Deployment <ul><li>Target Servers </li></ul><ul><li>Easily deployed as OSGi bundles with included http service </li></ul><ul><li>Deployed to traditional J2EE Application server using the “Servlet Bridge” </li></ul><ul><li>Cannot be deployed to a plain web server </li></ul><ul><li>Plug-in based Build and Deploy Process </li></ul><ul><li>All plug-ins should be contained in a feature </li></ul><ul><ul><li>Make the PDE build process easier </li></ul></ul><ul><li>Run PDE build to generate bundles </li></ul><ul><ul><li>Reformat code to PDE format </li></ul></ul><ul><ul><li>Call PDE build </li></ul></ul><ul><ul><li>Unzip and reformat the PDE build result </li></ul></ul><ul><li>Upload build result to application server </li></ul><ul><li>Run deployment scripts on application server </li></ul>http://www.eclipse.org/equinox/server/http_in_container.php
  40. 40. GWT – Plug-in Deployment <ul><li>Target Servers </li></ul><ul><li>Can be deployed to an OSGi based server using plug-ins </li></ul><ul><li>Can be deployed to a more traditional J2EE Application server as WAR file </li></ul><ul><li>Easily deploy simple apps (e.g. financial calculator… no RPC) to plain web server </li></ul><ul><li>Plug-in based Build and Deploy Process </li></ul><ul><li>Switch GWT library jar file (gwt-user.jar ----> gwt-servlet.jar) </li></ul><ul><li>Call the GWT compiler to compile Java to JavaScript </li></ul><ul><ul><li>Generated JavaScript placed into a plug-in </li></ul></ul><ul><li>Run PDE build to generate bundles </li></ul><ul><ul><li>Reformat code to PDE format </li></ul></ul><ul><ul><li>Call PDE build </li></ul></ul><ul><ul><li>Unzip and reformat the PDE build result </li></ul></ul><ul><li>Upload build result to application server </li></ul><ul><li>Run deployment scripts on application server </li></ul>
  41. 41. GWT – Traditional J2EE Server <ul><li>Target Servers </li></ul><ul><li>Can be deployed to an OSGi based server using plug-ins </li></ul><ul><li>Can be deployed to a more traditional J2EE Application server as WAR file </li></ul><ul><li>Easily deploy simple apps (e.g. financial calculator… no RPC) to plain web server </li></ul><ul><li>Traditional J2EE based Build and Deploy Process </li></ul><ul><li>Switch GWT library jar file (gwt-user.jar ----> gwt-servlet.jar) </li></ul><ul><li>Call the GWT compiler to compile client-side Java to JavaScript </li></ul><ul><ul><li>Generated JavaScript placed into a plug-in </li></ul></ul><ul><li>Call javac to compile server-side Java code </li></ul><ul><li>Create WAR file containing client-side JavaScript and server-side Java </li></ul><ul><li>Upload build result to application server </li></ul><ul><li>Run deployment scripts on application server </li></ul>
  42. 42. Build and Deploy Summary <ul><li>Build </li></ul><ul><li>Automation is a must </li></ul><ul><li>Consider Continuous Integration </li></ul><ul><li>Deployment </li></ul><ul><li>Easier to deploy RAP than GWT to an OSGi based server. </li></ul><ul><li>May be easier to deploy GWT than RAP to a more traditional application server. </li></ul><ul><li>Construct build scripts such that apps can be deployed both on the local machine and on the server </li></ul>
  43. 43. Performance <ul><li>How fast are apps built with these frameworks? </li></ul>
  44. 44. Performance – Loading Pages <ul><li>Various load times for our test application… </li></ul><ul><li>GWT is slightly faster… why? </li></ul><ul><li>Does this make a drastic difference from an end user’s standpoint? </li></ul>0% 50% 0% 50% 15% 35% ½ n/a n/a ½ Traveling Home Traveling Home Traveling Home ¾ ¾ n/a ¾ 2 3 3 3 1 n/a n/a 2 Sort List 1 2 n/a 3 Load Folder 3 5 5 8 Load Page Cached Cached GWT RAP Seconds to load
  45. 45. Performance – Image Bundling <ul><li>Look at the whole stack, don’t just look at the application </li></ul><ul><li>Faster to load one bigger file than many smaller files </li></ul><ul><li>GWT provides functionality to combine multiple small images into a single large image for efficient transport to the browser </li></ul><ul><li>This is planned for RAP. Something comparable to image-bundles is just finding its way into Qooxdoo 0.8, and the RAP team will investigate once that is in place. </li></ul><ul><li>Incorporating this functionality in RAP would reduce the time to load a page. </li></ul>http://www.screaming-penguin.com/docs/gwt-1.4.10/doc/html/com.google.gwt.doc.DeveloperGuide.UserInterface.ImageBundles.DefiningAndUsingImageBundle.html MyImageBundle imageBundle = (MyImageBundle) GWT.create(MyImageBundle.class) imageBundle.printerIcon().createImage(); imageBundle.notesIcon().createImage(); imageBundle.editIcon().createImage(); imageBundle.graphIcon().createImage(); …
  46. 46. Performance – Communication <ul><li>In general, RAP pushes more work off the client onto the server, thus communicating more information and more frequently with the server. </li></ul>Lookup Page Display Page Process Actions Render Changes Page Request Browser Server Lookup Data XMLHttpRequest RAP GWT Layout Page Display Page Process Actions Render Changes Page Request Browser Server mouse and key events mouse and key events Lookup Data
  47. 47. Performance – Packets <ul><li>GWT is faster sorting because more information is cached on the client and more processing is kept on the client… </li></ul><ul><li>… but interesting that in our application, RAP is slightly more efficient loading a folder the first time… why? </li></ul>(1) Sort List 6 times by clicking on columns 1, 2, 3, 1, 2, 3 (2) Load a different folder then load the original folder again 349 4 2602 6 Load Again (2) 3827 8 2900 8 Load Folder 4661 11 25390 63 Sort List (1) Bytes Packets Bytes Packets GWT RAP
  48. 48. Performance – Virtual Tables <ul><li>RAP passes only the information necessary to display the visible rows in the table </li></ul><ul><li>In our GWT app, the entire table content is loaded the first time it is needed and cached on the client. We could have loaded only what we needed to reduce the refresh time. </li></ul><ul><li>Bottom line : GWT is more flexible and potentially faster, but by how much and at what cost (complexity) to the developer? </li></ul>RAP GWT
  49. 49. Performance – RAP in Eclipse.org <ul><li>EPP working on a RAP wizard Eclipse downloads </li></ul><ul><li>Load test executed against desktop computer with </li></ul><ul><li>Core2Duo 2.8 GHz </li></ul><ul><li>Ubuntu </li></ul><ul><li>JVM </li></ul><ul><ul><li>max of 512 MB of heap space </li></ul></ul><ul><ul><li>concurrent marksweep garbage collector (-UseConcMarkSweepGC) </li></ul></ul><ul><li>Tomcat 6 </li></ul><ul><li>Jmeter 3.2 </li></ul>
  50. 50. Performance – RAP in Eclipse.org <ul><li>Throughput of 100 requests/second </li></ul><ul><li>Average response time of 14 milliseconds </li></ul><ul><li>Standard deviation of 60 - 80 milliseconds (due to periodic garbage collection) </li></ul><ul><li>250 MB of heap needed for 1000 concurrent sessions </li></ul>Overhead = 250K / session
  51. 51. Unit Testing <ul><li>Both RAP and GWT are based on Java, so… </li></ul><ul><li>JUnit can be used to test the server-side code </li></ul><ul><li>But how to test the client-side? </li></ul>
  52. 52. RAP – Unit Testing <ul><li>Non-UI code can be tested using standard JUnit </li></ul><ul><li>UI code can be tested using JUnit (new June 2008) </li></ul>public class RapJUnitTest extends RAPTestCase { public void testOpenView() { try { IWorkbenchPage page = getPage(); page.showView( &quot;org.eclipse.rap.demo.DemoTreeViewPartI&quot; ); } catch( PartInitException e ) { e.printStackTrace(); } assertEquals( 1, getPage().getViewReferences().length ); getPage().hideView( getPage().getViewReferences()[ 0 ] ); assertEquals( 0, getPage().getViewReferences().length ); } private IWorkbenchPage getPage() { IWorkbench workbench = PlatformUI.getWorkbench(); IWorkbenchWindow window = workbench.getActiveWorkbenchWindow(); return window.getActivePage(); } } RAP includes a special RAPTestCase base class that provides JUnit integration
  53. 53. RAP – as compared to RCP <ul><li>The differences between RCP and RAP are small… </li></ul><ul><li>… only the underlying libraries are different but with the same API so that you can switch between </li></ul>RAP RCP
  54. 54. RAP – switching between RWT and SWT <ul><li>Once you import and select your RAP target platform … </li></ul><ul><li>… and import packages (not bundles) … </li></ul>… you can easily switch between SWT and RWT
  55. 55. GWT – Unit Testing <ul><li>public class FooTest extends GWTTestCase { </li></ul><ul><li>// Specifies a module to use when running this test case. </li></ul><ul><li>public String getModuleName() { </li></ul><ul><li>return &quot;com.example.foo.Foo&quot;; </li></ul><ul><li>} </li></ul><ul><li>public void testStuff() { </li></ul><ul><li>myService.doSomething(arguments, new AsyncCallback() { </li></ul><ul><li>public void onSuccess(Object result) { </li></ul><ul><li>finishTest(); </li></ul><ul><li>} </li></ul><ul><li>public void onFailure(Throwable caught) { </li></ul><ul><li>… test failed … </li></ul><ul><li>} </li></ul><ul><li>}); </li></ul><ul><li>// Set a delay period significantly longer than the event is expected to take. </li></ul><ul><li>delayTestFinish(500); </li></ul><ul><li>} </li></ul><ul><li>} </li></ul>http://code.google.com/webtoolkit/documentation/com.google.gwt.doc.DeveloperGuide.JUnitIntegration.html GWT includes a special GWTTestCase base class that provides JUnit integration Must specify GWT module Optional support for asychronous test finish and specification of maximum execution time
  56. 56. AJAX Security Issues <ul><li>There are many AJAX security issues and people much more qualified to talk about security than us. </li></ul><ul><li>Attack vectors include: </li></ul><ul><li>cross-site scripting (XSS) </li></ul><ul><li>manipulating client-side logic </li></ul><ul><li>defeating logic protection techniques </li></ul><ul><li>function hijacking (client-side code being changed) </li></ul><ul><li>JavaScript Object Notation (JSON) hijacking </li></ul><ul><li>denial of service attacks </li></ul><ul><li>hacking Google Gears </li></ul><ul><li>Bottom line: Server should not implicitly trust any information inbound from a client </li></ul><ul><li>Article: http://www.adtmag.com/article.aspx?id=21773 </li></ul><ul><li>Video of security talk at GWT Conference: </li></ul><ul><li>http://www.ongwt.com/post/2008/01/06/GWT-Conference-:-GWT-Security </li></ul>
  57. 57. ATF – AJAX Toolkit Framework <ul><li>Eclipse.org project for AJAX tools in the Eclipse IDE </li></ul>ATF RAP and GWT Editing, debugging and deployment of JavaScript Editing and debugging of Java while keeping JavaScript at “arms length” vs http://www.eclipse.org/atf/
  58. 58. Thin Wire <ul><li>Similar to GWT but using Swing/AWT </li></ul><ul><li>http://www.thinwire.com/ </li></ul><ul><li>“ ThinWire Handbook” ISBN: 0132366223 </li></ul><ul><li>Of note: last “news” entry dated 5-30-2007 </li></ul>
  59. 59. More Information <ul><li>RAP </li></ul><ul><ul><li>http://www.eclipse.org/rap/ </li></ul></ul><ul><ul><li>http:// www.eclipse.org/rap/demos.php </li></ul></ul><ul><li>GWT </li></ul><ul><ul><li>http://code.google.com/webtoolkit/ </li></ul></ul><ul><ul><li>http:// code.google.com/webtoolkit/examples / </li></ul></ul><ul><ul><li>http://www.asquare.net/gwt/ </li></ul></ul><ul><ul><li>http://code.google.com/p/gwt-ext/ GWT Ext </li></ul></ul><ul><ul><li>http://extjs.com/products/gxt/ Ext GWT (was MyGWT) </li></ul></ul>
  60. 60. Enter to Win <ul><li>Evaluate any of the WindowBuilder family of products by 19 December 2008. </li></ul><ul><li>Only attendees at this meeting may enter. </li></ul><ul><li>Begin your product evaluation at http://www.instantiations.com/eclipseusers-se </li></ul><ul><ul><li>To enter the drawing, you’ll complete a form, then download, install and activate one of these by 19 December. </li></ul></ul>Take a card as a reminder
  61. 61. Java Tools for Professional Development Teams