Grzegorz Kossakowski skrev:
Daniel Fagerstrom napisaĆ(a):
Grzegorz Kossakowski skrev:
...
A modern form framework
=======================
Being a little bit provocative I'm starting to find CForms rather old
fashioned in style. Why so much server side stuff wouldn't it be
better with a form framework where most of the form framework is
client side and invokes REST style web services for the CRUD
operations on the server side resource that the form updates.
Yes, you are provocative here and to be honest not really convince me
but I think it wasn't your goal to do so. I really prefer having good,
stable, documented and powerful form framework than new, shiny and
fashionable form framework :-)
I think that it must be provided a long sequence of good arguments to
throw out one of the best Cocoon's block and start implementing new one...
[And from earlier in the thread]
Also we could need some "convention before configuration" and
>> "don't repeat yourself" in our forms framework. JBoss Seam
>> ( http://labs.jboss.com/portal/jbossseam/,
http://www.infoq.com/articles/jboss-seam)
>> does some cool stuff that we could imitate. Especially it uses Hibernate
>> annotations for form validation
http://docs.jboss.com/seam/1.2.0.PATCH1/reference/en/html/validation.html.
I don't propose that we should throw out the current Forms framework.
What I do propose is that it could be improved so that it would require
less work to use and so that it would support AJAX+REST style webapps
better.
Don't repeat yourself
=====================
As an alternative to using XML configurations for form definition and
binding both the form definition object and the binding object could be
configured from annotations in the model bean. With some decent set of
conventions, people who follow the conventions would be able to connect
forms to the business model with considerably less code writing. JBoss
Seam is a good example of what I have in mind.
AJAX+REST friendliness
======================
IMHO the preferred webapp architecture will move from MVC model 2
towards the kind of architecture described in figure 2 in
http://www-128.ibm.com/developerworks/websphere/library/techarticles/0606_barcia/0606_barcia.html
and in http://websphere.sys-con.com/read/196269.htm.
One way to support such a architectural style with our forms framework
would be to refactor it so that it allows for a more RESTish
communication style. Think about the form instance as a resource that
can have JSON (or XML) representation that you can GET, PUT, POST or
DELETE. One could also have support for letting the client ask for tthe
data types of the form for supporting client side validation.
/Daniel