We're building a game, so that may help to put the objects into context better.
I have a situation where I have a structure kind of like this..
- Template
- Data(ICollection<Statistics>)
- Character: Template
- Data (ICollection<Statistics>)
To elaborate... Let us assume that every character has a property "Health". Now, the default for "Health" is 15.
Now let us assume that every character starts with that. As a character over its lifetime, it might add to "Health" with new values. But they still need to retain the default reference.
Now, 'Character' inherits defaults from 'Template', but each character will have its own set of data that appends the defaults. Raw inheritance does not work because the Item appends, it does not overwrite. The original defaults still need to exist.
I can solve it like this..
- Character
- Template
- Data (ICollection<Statistic>)
But this is redundant to me. It requires a lot of extra database calls. Basically every call to a item has to do the same code twice because it has to construct a Template object too.
Is there a more logical way to go about this?