tags:

views:

200

answers:

3

I am doing an application like Form builder in Cakephp.

I've created the module for Designing the forms. Is it a good way to create a separate table for each forms in the case of form building?

A: 

I don't think so. The database design should come first and it should be a clean, simple and as efficient as possible. Then you build your forms.

A good form building app should be able to look at a database table, or a group of tables, and figure out what belongs where, what type of content is being stored (Ints, primary keys, text, blobs, URLs) and function with as little configuration from the end user as possible. Otherwise you're not going to be able to normalize your database, and you're going to have all kinds of data all over the place.

It's easy enough to get the info on a particular table. That's the best route I think.

gargantaun
A: 

Like gargantaun said, start with the DB tables.

I'd want an easily overridable layer between the DB and the forms to manage the relationships between the two and make explicit the data relationships you can't get from the DB.

Someone will surely want to generate multiple forms from the same table (perhaps one form would be too long, perhaps there are different user levels).

The killer feature of something like that is always how well it handles foreign keys in the DB and one-to-one, one-to-many etc. relationships. Not much use if you can't even build a shopping cart with multiple items in it.

wbg
A: 

I've used an Entity-Attribute-Value data model for both identifying what fields a form in my form builder plugin requires and for storing the data from each form. Wholly recommend it - it's scalable and totally flexible.

neilcrookes