My question is about a design related problem.
Below is the class diagram, which is close to a MVC model. Basically the View owns a DataContainer. The DataContainer has many different kinds of Data (Data1, Data2, ..). It also has a DataModifiable. The DataModifiable is actually modified during time by ModifyingThread. The ModifyingThread is created by the View class.
View ------- ModifyingThread
| |
| |
DataContainer |
| | \ |
| | \ |
Data1 Data2 DataModifiable
The DataModifiable should be read-only for the DataContainer and is writable for ModifyingThread.
Here is my question: Which class should own the DataModiable and which class should create it? Is it the DataModifiable or the DataContainer?