Announcement Announcement Module
Collapse
No announcement yet.
Form builder Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Form builder

    Hi guys,

    Okay, this is my very first post here, though I have been lurking around much while learning the ins and outs of Spring+Hibernate.

    A bit about what I'm trying to do with Spring+Hibernate right now: a Form builder which allows users to create custom web forms, something like this: http://www.form-maker.com/online_demo.html

    Now, it's probably straightforward in the sense that I can dump all the key/value pairs into a database table. But what if I have certain fields that are to bind to certain domain objects? Say, the form contains the first name and last name fields that I must bind to a Members table. And the form can also contain user-defined fields such as hobbies, weight/height or whatnot that I would have no way of knowing beforehand.

    My idea is that first name and last name fields are the mandatory fields that can map to the Members table, and I'd have another table to capture all the rest of the custom fields. Do you guys think this is logical? Or am I barking up the wrong tree? And is there a way to work this in using Spring and Hibernate?

    So basically, once the user configures a form, it is persisted and possibly rendered to a JSP file or something. The form can then be called up by visitors to the website. The visitors can fill in the form and the normal validation and response will hold for this form.

    I have been trying to get my head round all these, and am almost feeling that it might be too complicated or impossible to do. Also, I have been tinkering with all the different view technologies, like Tapestry, Spring Web, JSP/JSTL, and not too sure which one would best suit such needs.

    Would appreciate if someone with a clearer mind to point me in the right direction.

    Thanks and cheers!


    Ron

  • #2
    Form builder

    Ron,

    It looks like the "form-maker" product is only intended for simple form data that gets mailed from a website. Building an application like that for non-trivial forms that require an object model would be a lot harder. You would first need a metadata model for the form layout and controls. You would also need a way to build the data model via the web and map it to the object model (a way to generate the hibernate mappings). Finally, you would need a way to design views that use the form metadata model to display the form and process it. It gets to the point where the application user has to have the knowledge of a web designer to use the system.

    You could always offer your own data model that caters to a certain niche. That way, users could still build custom forms that would serve their needs, but the data model would already be established. You could define hibernate mappings for the form layout metadata and store the customized form in the database with links to the parts of the data model the user needs.

    If you don't require a "build-over-the-web" solution, then Spring and Hibernate provide everything you need. There are already some pretty good visual ORM tools that make the design process a lot easier. If you use Eclipse, check out the Hibernate Synchronizer plugin. It takes care of much of the Hibernate mapping work for you.

    Hope that helps,
    Derek

    Comment


    • #3
      Re: Form builder

      Thanks for the reply, Derek.

      Originally posted by dadams
      Building an application like that for non-trivial forms that require an object model would be a lot harder. You would first need a metadata model for the form layout and controls. You would also need a way to build the data model via the web and map it to the object model (a way to generate the hibernate mappings).
      Yes, those are the areas I am wrapping my head around. I was just wondering if this is the route I must go, like reinventing some of the stuff (like form controls) that are already out there. But the more I look, the more it seems that I have no other ways.

      Originally posted by dadams
      You could always offer your own data model that caters to a certain niche. That way, users could still build custom forms that would serve their needs, but the data model would already be established. ...
      Yes, in order to manage the scope and avoid risking making the application too difficult to handle, this is the way I will do it, by targetting a certain niche usage. Will do more thinking on this and hopefully come up with something concrete.

      Originally posted by dadams
      If you don't require a "build-over-the-web" solution, then Spring and Hibernate provide everything you need. There are already some pretty good visual ORM tools...
      It will actually be part of a bigger application and it has to be a "build-over-the-web" solution.

      Thanks again for the help. Will head back to the drawing board and come up with something to make this work.

      Cheers,
      Ron

      Comment

      Working...
      X