Sylvain Wallez wrote:

Hi,

Some people to which I demonstrated Woody and Flowscript asked me how we can directly map forms to a database.


no surprise here :-)


Yeah, I know that architecturally having intermediate domain objects is better, but it seems a bit overkill when what you need is just a simple CRUD front-end to a database and have no additional logic.

Writing a SQL binding for forms seems a complicated beast to me (maybe I'm wrong as I'm not very fluent in SQL), so I was thinking of using tools that would to the dirty work for me.


I have been thinking about the direct sql mapping on and off, the biggest problem I was able to identify (not solve) is that sql is not 'symmetric' in its load and save operations (while woody binding is)


with symmetric I mean for doing updates or inserts you can't just give a resultset back to the JDBC connection...

And here comes (Antonio, you'll be happy!!) OJB, which AFAIK can persist DynaBeans [1].

So what about adding a getBean() to the widget interface that would return a DynaBean wrapper of the form widgets? A simple OJB mapping file and voil�, persistant forms!


Wow. This would set asside the usage of the form.save(object) alltogether then?


I'm not into OJB enough to understand just how simple this simple mapping file would be, some example/hint might help understanding the usability...


What do you think?


I think it would make for a killer usage pattern for the easy-apps!


And it makes sense: the form-definition model is in fact to be seen as a 'class' definition of form-instances, no?
(maybe in stead of dynabeans you could abuse the opportunity to boost your bcel skills again ;-))


Sylvain

[1] http://jakarta.apache.org/commons/beanutils/api/org/apache/commons/beanutils/DynaBean.html



-- Marc Portier http://outerthought.org/ Outerthought - Open Source, Java & XML Competence Support Center Read my weblog at http://radio.weblogs.com/0116284/ [EMAIL PROTECTED] [EMAIL PROTECTED]



Reply via email to