I'm having trouble defining this data pattern I've come across working on several applications.
It consists of:
- An object type which is composed of many objects itself
- A second object type, where each instance 'has many' of the first object
- And, each of the sub-objects of the first object are modifiable per each association to the second object type.
A simple example might be:
- A programming course consisting of a set of lessons
- The lessons are composed of a set assignments.
- A course can be assigned to a student.
- However, once a course is assigned to a student each lesson and/or assignment can be customized to that student, with removals and additions, to the point where the original course may be unrecognizable.
In my solutions, what this results in is:
On assignment of a course to a student, the course is loaded into memory. Then for each sub-object, a student/sub-object relationship object is generated with the appropriate metadata. Essentially, I'm using the original object as a template to generate the required customizable objects.
This results in a huge amount of data as the sub-objects become more complex and numbered. I'm wondering if there is some optimization or pattern to reduce the amount of logic/complexity required to manipulate this data pattern.