Archive for June 20th, 2007

Spring One - GWT

Wednesday, June 20th, 2007

Bram Smeets talks about Google GWT.

Introduction to what Ajax is. Ajax = DHTML + Remoting (not necessary Javascript, it can be flash as well for example).

Problems with typical Ajax development: JavaScript is not easy (and many times new), Browser incompatibilities (JavaScript/Dom manipulation, working in xml, XmlHttpRequest), Browser history.

How do you overcome them? Use a framework. Another problem is that there are many frameworks out there. Many of them fix part of the problem. DWR for remoting, Dojo for widgets, … .

Introducing GWT, the holy grail for web development?. It is Googles answer. They develop web applications too and they try to answer how should a Java developer write a sexy, web application? The answer: In Java.

What is it? An architecture for developing rich internet applications. Concept similar to Swing / SWT (but it is centered around HTML and CSS). Uses Java to Javascript compiler.

Benefits: Quick responses to actions (Ajax), Browser compatibility, requires no browser plug-in or JVM (for example, Flex requires flash plugin), manages browser history, and keyboard navigation, one language for server and client side, used the power of Java IDE, OO code and UI components, really simple RPC, easily integrate with existing technologies (such as Spring, JSF, Script.aculo.us), Open Source (Apache 2), [Shay: and do the dishes for you while you watch the last Sopranos episode].

GWT features: Has partial emulation of JRE for JavaScript (java.lang.*, java.util.*), Shell for debugging and testing UI code, UI widget library / DOM utilities, simple browser to server RPC mechanism, Native JavaScript support (JSNI).

Bram is doing a demo of a simple application with a button and a label. All the code is in Java. You can run it within a hosted mode with a GWT console. You can debug your Java code very easily by running the GWT console in debug mode (Bram uses intelliJ, me like!).

Browser to server RPC. Ajax calls wrapped as RPC styles calls (implemented for you in a similar manner to Spring remoting). Servlet / Spring based servers side. It is Asynchronous, so you use callbacks to get back the results. Uses proprietary wire format (for performance reasons), can use JSON as well. What can be serialized?: primitives, String/Date, and any Java type (as long as it is serializable).

Some drawbacks: No Java 5 support on the client side. RPC services have to implement RemoteService tagging interface (the service layer is now dependent on GWT library). User defined types going over the wire have to implement IsSerializable tagging interface.

Some solutions: Use GWT specific service facade. Use DTO and DTO converters ([Shay: not nice at all]).

GWT 1.4 new features: Size and speed optimization, deployment enhancements (modularize RPC mechanism, just reference xxx-nocache.js, cross site scripting), Widgets and Library enhancements (New widgets - RichTextArea, SuggestBox, Splitters), Benchmarking subsystems, no need for IsSerializable, can just use Serializable, and much more… .

Tips and tricks: Use a skeleton application to get started. Use an IDE plug-in to enhance productivity, use obfuscated as the output format (especially in production), create reusable components / widgets (look whether someone else already created one, use Composite base class to hide internals), Secure your server-side calls / URLs using Acegi, use Google Gears for offline applications, define your own AbstractAsyncCallback (for centralized error handling).

Conclusion and benefits: Remain in Java domain (debugging, unit testing), browser anomalies abolished, cleans separation of (static) web content / dynamic GWT code and server side code, Open Source, aggressive caching, code optimization. Has a lot of momentum.

Spring One - Keynote

Wednesday, June 20th, 2007

Rod Johnson is on stage now. First talking about Spring .NET (in a fricking Java conference!) and brought up Mark Pollack on stage showing off Spring .NET simple usage with AOP, declarative transactions, web services. The demo went well though Rod thought that the demo was showing .NET and Java interoperability, but instead it was showing plain .NET default web service client.

Rod talks about the recent VC investment in Interface21, describing it as an analogy of having a really strong cup of coffee ([Shay: does Interface21 needs more wakening to do?]). Talks about what can you do with $10m?: Some examples: eradicate fire ants from Australia, buy chemical weapons detection and protective clothing in Canada, and some more obscure examples. So, with Interface21, the goal is …, wait for it …, invest in Spring and Spring portfolio.

Rod states that Open Source is not about being free, but about providing quality software. Two key values in Spring is simplicity and power, and the mission is to continue and do just that. Spring won’t go and get into areas that are perfectly ok, but will get into areas that are not easy/simple to use. ([Shay: anybody wish to venture a guess?).

Rod now goes over how widely Spring is used. Very high job demand. He compares “spring and java” and “jboss and java” and shows that Spring has overtook JBoss.

Spring has set the bar high, with Forrestar and some other source stating the quality of Spring. Rod thanked Jurgan Holler for this. So, where does $10m goes? Most of it will go into continue and maintain the quality of Spring. A dedicated development centers with dedicated developers investing time in different Spring components / portfolio. You will see x2 increase in Spring Web, x3 increase in Spring core.

Rod talks about “The Eclipse Effect”. Java IDE world has two solutions, Eclipse as the major one, and intelliJ IDEA where they keep innovating and keeping Eclipse honest ([Shay: let the Sun people start to cry about Netbeans]). He now compares IDE world in the past where there were several IDEs, but they were of low quality. And now with Eclipse IDE, which is dominant in the market, people who invest things in Eclipse immediately get into a wide market (for example by writing Eclipse plugins). Now the analogy to Spring, where Spring is becoming such an environment as Eclipse for third party development.

Major players are: BEA - use Spring internally within WebLogic10 where every EJB and other Java EE component is also a Spring bean. Oracle Fusion middleware is built on top of Spring (oc4j, Oracle Coherence, JDeveloper, …). GigaSpaces - version 6 has “native” support for Spring pojo programming model ([Shay: I guess he talks about what I have been up to :)]). Rod talks about GigaSpaces OpenSpaces remoting which is based on Spring Remoting and provides exactly the same “look and feel” simply with exporting virtualized services (that can handle fail over and load balancing). [Shay: He seems to spend a lot of time on this, a bit of an ego boost since I wrote it :)]). IBM and certify Spring on WebSphere ([Shay: exactly what you would expect from WebSphere and the red tape way of thinking, certifications galore]).

Now, my battery is dead which always reminds me of this scene from True Lies: