GWTUML - Just Enough UML for Wikis
Florian Mounier has spent the last six months developing GWT UML, a slick little UML diagramming tool written in, obviously, GWT. It's smooth, good looking, supports class, object and sequence diagrams. You can save your diagram as a url or export it to an SVG. You wouldn't try to do model driven development with it, but for embedding in a development wiki, this thing could rock.
You can find more information at the google code project and check out a demo here.
Week in Review
Some interesting posts from around the blogosphere:
- The GWT Plugin for Grails has been stuck in version 1.4.x of GWT for forever. Michael Galping has published a two part (one and two) series at IBM Developerworks on integrating Grails and GWT 1.5.3. Extensive, well illustrated with full source code available for download.
- InfoQ has published an interesting conversation about Ajax and COMET versus HTML Web Sockets, i.e. hacky COMET versus real bi-directional communication mechanisms between the server and browser.
- UXDesign.com has a concise summary of an Alan Cooper Interview video from 2008. User Experience Design, baby!
- David Hamill has some provocative musing on the difference between usability and user experience design. Not sure I agree with everything he has to say, but it's a question that comes up often and is worth thinking about.
- A bit older, but I just came across it: the original ScrumMaster, Jeff Sutherland, has an interesting article about ROI and incremental development. The conclusion? Incremental is better.
But seriously, we don't have enough rigorous thinking and writing about how good design and process reduces the cost of software in the long term (while perhaps increasing it in the short term).
These were some of the posts that I found valuable over the last week. Please share yours in the comments.
IT Mill Toolkit 5 out of Beta
With the release of IT Mill Toolkit 5.3.0, the server-side RIA framework is now ready for production. I announced the initial release of 5.0 back in December of 2007. Since that time, IT Mill 5 has gone through several revisions and the release of GWT 1.5 (which means you can use Java 5 now on both the client and the server). As a reminder, server-side RIA frameworks let you write your app completely in the server and uses a client-side Ajax engine to render the interface. The nice wrinkle with IT Mill is that both the server side and the client side are written in Java, so if you want to add a component, you don't have to break out the JavaScript (see the extensive and high quality reference manual for details on how to develop your own custom components in GWT). If you're a Java shop, that's got to be a good thing.
Topics: Ajax Development, Ajax Frameworks, GWT, IT Mill Toolkit, Java, Server Side
PureMVC, Spanning the Platform Spectrum?
At Pathfinder we do a fair amount of desktop style development -- iPhone/Cocoa, WebForms, Swing -- and web application development -- Grails, Rails, JSP, ASP.NET, etc., etc.. In the last two years we, like a lot of other software development shops, have experienced a convergence in our efforts. The web is coming to the desktop in the form of Air and the Desktop is coming to the web in the form of RIA's. Now web MVC, which used to be a pretty benign pattern mostly concerned with app flow and validation, is starting to resemble desktop MVC, which has to deal with document-centric models and long lived views and all of the plumbing that requires.
So we recently had a powwow between all the different parties to talk about MVC and this convergence. With the exception of the insufferable Mac and iPhone developers and their disgustingly mature Cocoa framework, we all agreed it would be nice to have an application level MVC framework for each platform. We also agreed that Swing is a great example of what happens when the vendor doesn't provide such a thing -- spaghetti code that relies on component level MVC and hard wiring at the application level. There are a few MVC frameworks for Swing, such as TikeSwing and Spring Rich Client (soon to be superseded by Spring Desktop), but for every Swing app that has this sort of design, there are hundreds that are just a mess.
Continue reading »
Topics: Cocoa, Design Patterns, GWT, iPhone, Java, Javascript, MVC, PHP, Swing, WinForms
GWT and the Discipline of MVC
When you're developing a desktop or GWT application you're going to go through a bunch of iterations, tweaking the UI, adding components, etc. Sometimes in all of that work it is very tempting to take a shortcut and update a view directly from a controller (label.setText(model.messsageString)). That way lies madness. Before long you've got your view code strewn across the length and breadth of your application. Change the view or some aspect of the model and you're on a refactoring of biblical proportions.
In fact there's never a good time to break out of MVC, but sometimes you just don't know what sort of Observable your model should be. Will you be using a table, a tree, some custom component? In those situations I try to preserve MVC while punting the hard decision until later. To this end, I've written a little set of utility classes called SimpleModel. How do you use SimpleModel?
Continue reading »
Topics: Design Patterns, GWT, MVC
GWTQuery - JQuery-like Syntax in GWT
Many times open source projects are mute -- they have insufficient documentation. Good technical blogs can function as a sort of ad-hoc documentation. That's what I've tried to do, most recently with my series of posts on GWT and OpenSocial. Vinay, over at Web Technology I/O, often does the same. He's got a great post about Ray Cromwell's GwtQuery (JQuery-like syntax in GWT) and how to make it work.
I've been tinkering with this tool as well and am going to do my own writeup, but thought I'd give you all the heads up. BTW, according to Vinay, the compiled GWT JavaScript for GwtQuery clocks in at 712 bytes!! So much for GWT bloat.
GWT, Gadgets and OpenSocial, Part 2
Note: It is assumed that you know your way around GWT and Eclipse for purposes of this tutorial.
While developing OpenSocial applications can be a bit tricky, getting set up to develop can be a real pain in the neck. For this installment of OpenSocial and GWT, I'm going to go through the basics of setting up a simple Hello World gadget with iGoogle. We'll get into the details of signing up for other OpenSocial containers, testing, and so on, later. Right now we're just going to do the basics.
So, what do you need to build a Google Gadget with GWT for iGoogle? You need the following:
- The Google Web Toolkit
- The GWT Google Gadget API
- An account on iGoogle
- Access to the iGoogle sandbox
- Some public server space so you can serve up your gadget to iGoogle
Topics: Google Gadgets, GWT, iGoogle, OpenSocial
Chess Game Viewer in GWT
It's not quite done (the game notation looks like crap in IE), but I thought I'd give a taste of my latest labor of love, a chess game viewer in GWT. This is the sort of thing that is usually implemented as a Java Applet. A few others have already built chess viewers in GWT, but as they say in Full Metal Jacket, "this one is mine."
As I blogged a few weeks ago, I ported the Java chess library ChessPresso into GWT, which was a blast and an example of how you can leverage existing Java libraries to write browser-based apps.
In the example, I've pulled the eleven games of the recently completed world championship between Anand and Kramnik in a single page. The GWT app identifies all of the relevant tags, reads the PGN (Portable Game Notation) in those tags, then inserts a game viewer widget into the page.
What isn't working yet:
- Doesn't look so good in IE (a little CSS work)
- The notation pane isn't hooked in so you can click on a move and jump to the position
Anyhow, have a look and let me know what you think.
Update: OK, the notation panel is hooked up to allow clicking on moves to navigate aroung the game. Still looks like crap in IE, though.
Update: for those interested in some of my very few games that make me look good, see here.
Update: Another set of tweaks to display a collection of games, one 41 games PGN chunk and a 250 or so chunk. See here.
Topics: chess, Chesspresso, GWT, PGN
GWT, Gadgets and OpenSocial
I've been developing with GWT, OpenSocial and Orkut, using the gwt-google-apis project on Google Code (specifically the gadgets subproject). It's a nice enough api that makes it relatively painless to build gadgets in GWT.
This is a bit different from Didier's gOpenSocial library, which was an early success at building OpenSocial gadgets with GWT. But the google gadget library isn't really quite ready for OpenSocial. I've skinned my knee here and there, so I thought I'd give others the benefit of my experience.
So, first thing, how the heck do I get GWT to generate the
line into my manifest?
Topics: Google Gadgets, GWT, OpenSocial
JSONWrapper now on Google Code
The JSON utility library for GWT that I blogged about last week is now up on google code.
To recap, the idea is that you can write code like this
JSONValue root = JSONParser.parse(json); JSONWrapper obj = new JSONWrapper(root); String result = obj.get("map").get(1).stringValue();
when dealing with JSONValue objects.
As it's only one class, you could just include it in your source tree as code instead of using the jar.
Making GWT JSON not Quite so Painful
I've been using GWT to resurface interfaces of a variety of legacy applications -- J2EE, PHP, Rails -- and more often than not that means working with JSON returned from the server. One thing that I've found is that GWT's JSON support is kind of chatty. That is, you have to write a bunch of code like this:
JSONValue root = JSONParser.parse(json); JSONObject obj = root.isObject(); if (obj != null) { JSONValue map = obj.get("map"); if (map != null) { JSONArray arr = map.isArray(); if (arr != null) { if (arr.size() > 1) { JSONValue strval = arr.get(1); if (strval != null) { JSONString str = strval.isString(); if (str != null) { String s = str.stringValue(); // do something with the string } } } } } }
Yikes! Just to get the string in the second array item in the "map" key of the top level object. Truth is, most of the JSON I'm getting back is fairly predictable. And if it's not in that predictable form, it's an error that the client code can't recover from. I'd like to be able to write something like String result = obj.get("map").get(1).stringValue() without having to worry about NullPointerException's cropping up all over the place.
GWT Tutorial - Building A Model
Shalk Neethling has written up a nice, streamlined tutorial on how to build a model in GWT using the GWTx project's support for java.beans.PropertyChangeSupport.
The basic idea here is that while the browser is the View and the server side is the Model and Controller in MVC, you really should structure your browser side code as an MVC itself where only the Model interacts with the server.
Well worth a read.
Porting Java Libraries - Jazzed About GWT
I've been building GWT interfaces for a while now, and it's been pretty cool. My attrophied Swing skills are slowly coming back and the kinds of stuff I've written has been leagues beyond my early Ajax stuff. So far so good.
Throughout it all, I've been trying to obey my own principle of avoiding leaky business logic and sensitive data. That means that most of the heavy lifting, business logic wise, happens on the server side.
This past weekend, however, I got a rare chance to do some programming for myself. One of my hobbies is chess, and I've written a few programs over the years to help me study and analyze the game. Right now I'm putting the plumbing together for a web/iphone application site. I've got all the stuff that handles FEN, move generation, PGN and UCI (interfacing to chess engines) on the server side, and the application side is mostly concerned with board displays.
Restlet Ported to GWT
If you want to communicate with the server in GWT, you have GWT-RPC and you have JSON (and in fact a few different flavors of JSON). If, however, you pine for the elegance of a RESTful interface, you've had to roll your own.
Now the folks at the Restlet project have ported the Restlet API to GWT.
Thanks to the support for generics in GWT 1.5 RC1, we were able to achieve this port with reduced efforts and limited troubles. We had to get rid of the server-side features that don’t make sense in a browser, and of the APIs like NIO and logging that aren’t emulated by GWT. The major impact was the adaptation of the API to the asynchronous communication imposed by AJAX and GWT.
So now you can make much easier use of RESTful back ends. If you've been working with Rails or Grails, you won't have to ask why RESTful backends are good. If you want a quick intro to Restlets, see this quickstart.
MetaWidget - Convention over Configuration UI
I already know that I'm not going to do MetaWidget justice as I describe it. What the heck is it? According to the MetaWidget site, it is...
Metawidget takes your domain objects and automatically creates User Interface widgets for them, saving you handcoding your UIs and leaving you to concentrate on stitching together your application.
Think of a configurable form widget driven off of your beans through runtime inspection of properties, getters and setters, annotations, etc.
But wait, there's more. It automatically detects your backend at runtime and makes friends with Hibernate, Spring, Seam, Groovy, etc.
Continue reading »
Topics: Android, GWT, JSF, MetaWidget, Struts
About Pathfinder
Follow the Blog
-
Get a monthly update on best practices for delivering successful software.
Subscribe via email
Subscribe via RSS
Categories
Topics
Archives
- July 2009
- June 2009
- May 2009
- April 2009
- March 2009
- February 2009
- January 2009
- December 2008
- November 2008
- October 2008
- September 2008
- August 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
- February 2008
- January 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- July 2007
- June 2007
- May 2007
- April 2007
- March 2007
- February 2007
- January 2007
- December 2006
- November 2006
- October 2006
- September 2006
- August 2006
- July 2006
- June 2006
- May 2006
- April 2006
- March 2006
Blogroll
Recent
- Elements of Testing Style
- Aesthetics and Web Design
- Asterisk-Java Testing with Groovy
- 3 Misuses of Code Comments
- Fluently NHibernate
- Digging a Hole and Covering it with Leaves — The Software Development Version
- The Importance of User Experience - Do You Understand It in Your Bones?
- Writing Your Own Protocol With NSURLProtocol
- What’s In Your Dock: iPhone edition
- Feature Fatigue
