I have been working on a project that deals with, let me simplify, Schools and Students.
The general requirement is that certain Students could be assigned to certain Schools to work an internship.
But the Schools are not only Schools per se, those can be Hospitals, Prisons, Nursing Homes, etc..
Since I'm using an ORM and Entity classes, my first idea was to use Inheritance mapping, like, to have a parent class InternshipProvider with particular child classes...
However, another requirement is that this should be done so that any User in future can add the new instance of InternshipProvider by using a form AND at the same time to be able to add some specific properties. Sometimes to the class, and sometimes only to particular instance.
Per each instance, the InternshipProvider may have or not, a set of specific properties, which could be available on a form as text fields or choice options, or a subform, etc..
So I kinda solved it like this: There is the InternshipProvider class, among standard properties it has a long text property as well. And inside of that text property (field) are JSON key-value pairs, describing those specific fields and values stored.
There is also a "monster", custom form generator feature, that handles this fairly OK. Each InternshipProvider instance has a specific custom form assigned to it for future editing.
There are two reasons for these requirements:
- They want to eliminate a need for hiring a software developer in future.
- The domain IS complex and unpredictable.
Do you have a better idea? Is there some concept that covers this? Some design pattern or the likes? What would you say to the Client?
Thank you