« Some Sneaky AOP Talk | Main | Evil, but not Evil Enough »

Ex-Forms and Ant Propeties

After getting a better feel of XForms I have decided to roll my own form pages rather than using an existing XML format. I initially didn't want to create yet another xml to widget mapping, but nothing quite matches what I need. I even took a look at jelly-swing but there is way to much binding to the swing architecture when you consider that a console mode and non-swing GUI are in the initial design premise. So I am going to roll my own. Case and point, how does one make a checkbox show up with XForms? You do either (a) <input ... /> that is bound to an xsd:boolean value in the model, (b) <select appearance='full'> with one <item/> child. Both are counter-intuiotive to me and I would rather have one <checkbox /> element. I will use some ideas from XForms: like the nested label and help elements though.

That was Problem #1. Problem #3 was roller eating my post because of session expiration. But problem #2 is how to handle ant properites. Anyone who has done much with a ant build.xml knows that the variables ant users are set conter to the typical programming: the first setting of the variable sticks and later sets are totally ignored. This actually makes sense when put in context of a user-overridden values on the command line. But when taken in context of a "back" button in a wizard a first-set-win policy demolishes the concept of going back and changing values. There are two tasks, ant and antcall, that break that rule, and wizard will have to be another one. Overcoming the rules isn't that much of a problem with the ant APIs.

The true problem comes in unsetting the properties, there is no way via the APIs. You can get a Propeties object but that is just a copy, not the local value. So you cannot un-set a value. But the if and unless atributes go by whether the property is set or not set. I considered making some of my elements sensitive to true/false values, but the target would not be sensitive. This would make using properties to drive the dependent component installs impossible, which was the whole point to me of using ant to do the installs: to declaritively determiine the needed dependencies. But it's not insurmountable. The magic of introspection allows me to forcably introspect the values and change them. For anyone who thinks that RTTI is wrong, add me to your list of violaters.


This page contains a single entry from the blog posted on November 2, 2002 8:27 AM.

The previous post in this blog was Some Sneaky AOP Talk.

The next post in this blog is Evil, but not Evil Enough.

Many more can be found on the main index page or by looking through the archives.

Powered by
Movable Type 3.33