mardi 12 juin 2018

Modeling a Form in Code/Database (Not UI)

First, this is not about how to build a form in HTML/WebForms/etc. It is about modelling a paper form(like an application) in code and the database.

I work at a university and I often get requests to build smallish applications for students to apply to various university programs. These apps will gather some data and have a small amount of workflow associated with them. And there is usually some changes as semesters start and finish. The project owners may decide that the form doesn't capture the data they they need or that students aren't filling it out properly (or at all).

And that is where my problem comes in. I have been modelling these forms as objects (C# mostly) and storing them in a SQL database. The sql schema is one column per field. The database is probably the biggest pain point, as columns will keep being added. In one case, I had a form go from multiple fields to a single, essay type field and then back to multiple fields.

What would be the best way to model this data? The system doesn't change enough to warrant a dynamic field/answer model in my opinion. I've considered storing it as a blob (JSON, XML, NoSQL) but do not know how to handle schema changes to in-progress data.

Finally, if the answer is 'use this product', that's fine. But I am interested in how to handle this from a design perspective.

Aucun commentaire:

Enregistrer un commentaire