Sea change in Web vs. Desktop Development

In the late 1990s, I rushed in to web-app development with a million other developers, following the demand. At the time I accepted that it took more work to get a web app working than a desktop app, using the tools of the era.

But looking at Ruby / Rails and TurboGears:

http://www.turbogears.org/preview/docs/tutorials/eajaxtg/paper.html

It strikes me that it is now *less work and less code* to get the functionality shown here working in a web app w/AJAX, than it would be to get it working in a rich client with Swing or in a multi-tier application in Delphi. The idea above that desktop client apps are less work than web apps, is no longer true. We are now paying a penalty when we choose to create non-web-apps.

Switched to WordPress

After a few years of using a barely-maintained homegrown CMS / weblog engine, I’ve switched to WordPress 2.0. Through a few hours of tedious migration work, most of the old content has been preserved. Moreover, a set of Apache directives like this:

RedirectMatch story-275- http://kylecordes.com/2005/09/09/direct-swing/
RedirectMatch printable-275- http://kylecordes.com/2005/09/09/direct-swing/

makes all (or very nearly all) of the old URLs still work.

Direct Manipulation Java Swing GUI Talk

At the St. Louis Java User Group meeting on Sep. 8, 2005, I gave a talk on building “Direct Manipulation” user interfaces with Java Swing. Here are the slide and code from that talk. The slides are quite limited, as the talk was spent almost entirely in the code – this is the kind of talk I prefer to give, with a lot of technical depth crammed in to the time allotted. Unfortunately this makes it somewhat less useful for people who weren’t at the talk; I’ve thought of making a “screencast” of the presentation for that reason.

Source Code and Presentation: SwingTalk.zip

Update: The sample code that got the most attention was the “flying boxes” code in the swingtalk.ordering package; you can try it now via Web Start.

Update: I presented this code again at the St. Louis Code Camp on May 5, 2007. Alex Miller picked it up and revamped it to use the new Swing Application Framework stuff coming (most likely) in Java 7.

Looking for a Web App Generation Tool

I’m looking for a tool that makes it astonishingly easy to generate a web app that facilitates the editing of the contents of a bunch of database tables. Details follow…

I’m looking for a tool that makes it astonishingly easy to generate a web app that facilitates the editing of the contents of a bunch of database tables. I want to specify:

  • which tables to allow editing (and viewing)
  • which fields to allow editing (and viewing)
  • which fields to show dropdowns for (rather than making users type IDs)
  • what captions to use for all table and column names
  • constraints to enforce
  • constraints to notice and complain about, but not enforce
  • a reasonable user management system for the web app (login/password/rights/etc.)
  • rules that define row-level security, i.e. allow users to edit some rows of a given table but not others

I’d like a “generative” tool, one that spits out a fully functioning app which doesn’t depend on the original tool for runtime infrastructure.

The specification of the things above can be mostly textual. Drag-drop-UML doesn’t excite me all that much (though I’ve used such beasts for Java work before). The generation process must be customizable, since no tool is likely to meet 100% of my present and future needs.

The generated app will preferably be in PHP or Java. PHP seems reasonable as it is ridiculously easy to get up and running (at most, a few packages to isntall in a common Linux distro), and Java is reasonable because I use it heavily for other purposes anyway.

It should be possible to support several common DBs (SQL Server, MySQL, PostgreSQL) with the flip of a switch or two.

The generation process should act like a build process – i.e. the “source” of the application would be the specificaiton file plus perhaps a few files work of manually tweaked code.

OK, so I’m asking for a lot.

… but there are dozens (or even hundred) of tools out there, both commercial and open/free, that meet at least some subset of the above. I Googled for a few minute and was overwhelmed at how many there are to look at.

A good starting point is the Code Generation Network, and a few of the specific tools I saw are phpCodeGenie, PHPMaker, Camino, Jag, JRpt, etc.

Of course, it’s entirely possible that none of them does everything I need – but that’s OK too, there is another layer of tools out there that make it easy to get start with my own generative approach: FMPP, Jostraca, etc.

Enough hoping for tonight. If anyone out there has had a very positive experience with any of these tools, for the kind of problem I’m looking to solve, I’d love to hear about it.


A few clarifications, after the initial post:

  • For this particular need, I prefer a generative approach to an “executable model” approach, though I think the latter might be the long-term winner in MDA.
  • Yes, I know that I’m mostly asking for DB-centric CRUD operations, rather than a domain centric behaviour model. I have plenty of time for the latter approach (with lots of Java code, Hibernate, perhaps even a rules engine) in other place, but for today’s need, which is for the “admin” side of an application, DB-centric CRUD will do the job fine, with a little help from constraints, validation, etc.

JAR Bloat

I am surprised at how large the main client application JAR file is on my current Java project. I have a pile of source code which I have written over the last few months; it contains no generated code and no outside code (that stuff is in other jars).

This body of code results in a 506K JAR file. About 10% of that is because it is a “signed JAR” (An aside: it appears that signed jars actually actually sign each thing inside the JAR… much far higher overhead than .NET’s igned assemblies, which sign the whole thing as a chunk. I think .NET is on to something good with Assemblies with Sun missed with just-a-bunch-of-classes-in-a-JAR. Of course the latter has significant advantages also.)

Without the signing, the JAR is about 450K.

Javac optimization is on. There are ~350 classes in the JAR file. The JAR is compressed; wihtout compression it is around a megabyte.

– debug is on, so I get more helpful stack traces from the field when errant software somehow escapes our highly rigorous release process. Turning off debugdrops it to 424K signed / ~380K unsigned.

These numbers all seems enormous. The source code for the contents of this JAR, is only ~800K, and contain considerable comments, private identifiers, etc. My mental model of compilation suggests that it would produce tightly packed bytecode that tersely captures the executable essence of the source code in a small fraction of the bytes. This appears to not be the case.