In my last blog post about OnlineGlom, I talked about my experience creating Java bindings for libglom using Swig. This time I’m going to talk about the web side of OnlineGlom.
GWT
As I mentioned previously, OnlineGlom uses GWT for the UI with the GWT-RPC / servlet combo to interface with the Java bindings for libglom on the server. The honeymoon stage of my “relationship” with GWT is definitely over but I’m still pretty happy with it. As most people know, GWT lets you write code in Java which is compiled into optimized JavaScript that properly deals with issues between browsers. Besides the major advantage of not having to customize JavaScript for each browser, there are a couple of other nice features that I like.
One of these features is the GWT-RPC mechanism. This feature allows you to easily send Java objects back and forth between the client code and the servlet without too much hassle. There are a few restrictions on how the classes are defined but it’s easy enough to create conforming classes. A typical use for the GWT-RPC is to send model objects between the client and the server. I guess this is old news for J2EE developers but I still think it’s a neat trick and that it’s super convenient.
Another thing that I like about GWT that it’s written in Java. And I’m not just saying this because Java is one of the languages that I know well. I really think that the Java world has some great tools to make development easier and faster. The Eclipse JDT is the IDE that I use but Netbeans, IntelliJ IDEA and Emacs all offer excellent Java development environments. One of the things that I really like about the Java IDE experience is the ease at which you can debug your code. With the GWT Eclipse and Firefox plugins, you can set a break point in your code, refresh your browser and be debugging within a few seconds. It’s pretty nice.
Of course GWT development is not without problems. One of the issues that I’ve run into is the gap between developing the code and deploying the code. I’ve been deploying the OnlineGlom code on a server about once a week and I always seem to spend a few hours trying to figure out why things aren’t working. To be fair, some of the problems I’ve encountered have been caused by the fact that java-libglom uses JNI which is harder to deploy as a servlet dependency than a pure Java dependency.
Other problems, however, have been caused by the fact that the GWT team doesn’t produce the GWT Maven plugin so issues crop up as new GWT versions are released. At times it feels like the GWT Eclipse plugin and the GWT Maven plugin are trying to stomp on each others configurations. I think I have most of the kinks worked out now but it has been frustrating at times. I would use the GWT Maven plugin again in my next GWT project but I would use it from the beginning of the project rather than converting the project to a GWT Maven project mid-development cycle like I did with OnlineGlom.
One other minor issue I have with GWT is that the documentation isn’t that great. At first glance there seems to be a lot of information on the website but the example code tends to be very simplistic and it’s not always clear how to flesh out the examples into more fully functional code. Thankfully GWT is open source so not only can I use the Eclipse auto completion feature to read the javadocs as I’m writing code, but the source navigation also helps … although I think my F3 key is going to wear out soon.
OnlineGlom
Now that I’ve spent some time with Glom, I’m really impressed with it. It wasn’t immediately obvious to me how powerful an application it is but I’m now convinced. The examples included are a good showcase of the type of database application that can be created. And OnlineGlom has the potential to make things even more useful. I was getting my VAT filing in order last weekend, shuffling through folders, emails, invoices and receipts and thought that it might be a good idea to start using a glom database application to manage my freelance company. The only thing I would want to add is support for storing PDFs in the database so that I could save PDF receipts and digitally signed invoices. I think I’m going to file a feature request for this.
If you’re still with me, you probably want to see what I’ve been up to. Here are the example glom files displayed with OnlineGlom:
http://bagu.org:8080/OnlineGlomSmallBusinessExample/
http://bagu.org:8080/OnlineGlomLessonPlanner/
http://bagu.org:8080/OnlineGlomMusicCollection/
http://bagu.org:8080/OnlineGlomProjectManagerExample/
http://bagu.org:8080/OnlineGlomOpenismusFilmManager/
So far I have the glom list view mostly working in read-only mode. I haven’t worked on the aesthetics too much so there’s no styling and the layout is pretty simple. As a proof-of-concept, OnlineGlom has been successful and the task now is to turn what I’ve done into something more generally useful. In the short term, there are a few areas that need some attention:
- Make a release of java-libglom. We need to get java-libglom bindings packaged and included in distros. This will really ease the current pain of deploying the servlet. Murray has already been working on solving the nasty Python problem we hit with the bindings. Once this problem is solved, we need to decide how we want to distribute the bindings: as a separate release?, included with libglom?, should we include the generated Java source code in the release or let distros generate the source at build time? etc.
- Finish some of the TODOs for the list view. I don’t think the list view needs to be prefect just yet, but there are few TODOs that need some work.
- Create an example selection UI. Having separate instances of OnlineGlom to show the examples and demos is not so desirable. I need to create a way for users to be able to select which example they would like to try out.
- Implement the details view.
- Implement session management. This is needed so that users can login.
As you can see, there’s still a ways to go and I haven’t even mentioned inline editing. I’ll be working on this for a least the next month so keep your eyes peeled for more updates.
On an unrelated note, I’ve decided to rent a desk in a shared office in central Amsterdam, on Leidseplein to be exact. I’m hoping to get more exposure to Dutch and improve my productivity a bit by getting out of the house. If there are any Amsterdammers that want to meet up for lunch or a drink, drop me a line. Mijn Nederlands is niet zo goed maar ik begrijp en spreek een beetje. We kunnen in Engels praten als je mijn slechts Nederlands niet wil horen.

