Auchencairn, Galloway, Scotland, Jan 24, 2006
I actually don't have time to develop toolkits. I need to develop products. Products are what customers will buy, what I can hope to make my living from. I already have a very productive toolkit in Jacquard, and if I decided to abandon Jacquard there are a dozen other toolkits which look to be very good alternatives - Tapestry, for example, and Struts.
There are some good reasons for thinking of abandoning Jacquard. I started writing it in 1997, so bits of it are now nine years old. It dates back to the very early days of Servlets, and a lot of the design decisions I made then I wouldn't make now. It's also a very different approach to the approach taken by most of the rest of the industry, which is based on taglibs or MVC frameworks or both. But the most important reason for abandoning Jacquard would be that its user base is too small. I spend time maintaining the toolkit when I could be building product.
But... toolkits are what I like building, so I'm doing it again. I'm taking what I've learned from building Jacquard, and shaping a new and much more powerful toolkit. It's a slow process, because it has to be back burner work. But today one of the central concepts of Jacquard 2 came to life and started to work for the first time: the one-source-file web-app.
Most of what I do - indeed, most of the non-static websites in the web - is web front ends onto conventional databases. Of course Jacquard in principle doesn't care whether the back-end store is a SQL database or an object oriented one or a LDAP server or something else entirely; data access is 90% abstracted, and an objective in Jacquard 2 is to achieve the last 10% of the abstraction so that the identical same Jacquard binary can be run against entirely different sorts of data stores.
However, be that as it may, a website front-ending a database is a fairly simple thing. The database contains entity-types which have defined properties and relationships. For each entity type there are a number of possible views. There's a list view. There's a form view which makes every field editable. There's a page view which reveals every field without making any editable. And there are other potential forms and pages which show fewer fields, or make fewer editable. Finally there's some navigation glue which enables to user to browse the whole. Which form or page is shown is constrained by the security permissions as they affect the current user.
Even the widgets you use for different field types are highly constrained. If the underlying field is a date, you're going to use a DateWidget. If it's a foreign key onto another table, you're going to use some kind of a DataMenuWidget. If it's a text field, you're going to use a TextAreaWidget or an EkitWidget. If there's a link table, you're going to use a LinkTableWidget. And so on; these choices are constrained.
So: it should be possible to generate all the code - the SQL source, the Java source, and the configuration files - which define a web application from a single file. For simplicity of parsing and compiling, these days, it makes sense to use XSL - even more sense, seeing XSL is the language we use to apply final look and feel to the lists, pages and forms we generate... It should be possible.
It is possible. Today it started to happen. Today for the first time I used XSL transforms to convert a first cut at an Application Description Language into SQL and Java. The SQL is nearly perfect (still not generating my most ambitious constructs, but all the day-to-day constructs generate perfectly). The SQL source is not elegantly formatted, and it does not make intelligent use of natural primary keys where it could; but all the referential integrity constraints, all the link tables, all the permissions are being successfully generated. The database works now.
The Java's a little further off but definitely looks promising. I can
generate the right widgets with the right parameters for the right
fields. And I haven't even started generating the web.xml but that's
going to be trivial. I've spent a long time - four years now -
thinking about Jacquard 2. Now I've started to believe in it.
The venerable but still very powerful Jacquard toolkit, version 1.
Ends. |
[NITF]
| Link this story:
|
|
|
|
This is the standard PRES template
templates/standard/default/pres-nitf.xsl
,
with the main PRES logo and the google ads removed.