Hello,
I work for an ASP.NET application. To put you in the context I'll describe it shortly. This application aims to collect data about applicants and employees in a big companies. As you guessed the application is based on forms where users can fill information about applicants/empoyees (name, phone, job description, experiences, skills, etc. etc.)
In fact each company has different needs (new fields in the forms etc. etc.) We don't want to go to the code each time we want to add/remove any fields. So the idea is to allow user to create the controls from administration menu.
The challenge is to design an object model which describes a control (Dropdown list, text Area, etc.) and its stored values.
Exemple: Admin adds from adminstration menu an dropdown list to the "Employee form". He provides a name for a control, label of a control, values to display, etc. etc. He clicks on "Save" and the desciption of a control should be saved in a database. When form is displayed to user in order to collect data, the "dynamic" control from database should be shown as well and the value selected/entered in the field should be placed in a database as well.
I don't speek that control can have different presentations (BackOffice, FrontOffice, forms, views) and can be required on FO but not in Bo. Can also have validation rules (client side and business side) and translatabled values and labels.
Where I'm confused is the part where busines and Presentation is mixed. Because the presentation of a control needs to be also saved in a database.
I wouldn't like to do something specific for ASP.NET, i should also be possible to implement it in WPF or other applications (at least the business logic of dynamic controls even if some GUI plumbing code should be done to map real controls to its dynamic definition from database).
I though of creating my business logic that represents a Control (name, label), ControlValue, ControlPresentation (FrontOffice, BackOffice, webService), ControlType(depends on ControlPresentation and can be DropDownList, Label, TextBox, etc. etc.). that business logic should be persisted in a database.
Than, an independed mapper should take care of dispalying real controls and values on a user interface from my business logic controls.
I don't really know where the business rules should be and when translation of controls/values should occur.
So if you have an idea of what should I do or avoid to do I'll apreciate. If you see in it an design pattern to apply it could help.
I don't want to do a higly coupled code to it's implementation. Don't hesitate to ask me questions if it's not clear.
Thanks in advance.