I have four classes:
1: one that owns the data
2: another that updates the data
3: third that is informed by the first about certain changes of the data
4: last that reads certain properties from the first class
I do not want any other class but the second to be able to update the data.
So what is the best deign patter to use here ?
More on the problem:
1st class is called Schema and it holds a counter of how many instances using that Schema there is.
2nd class is called Factory and it creates/deletes these instances, hence I need to update Schema instance counters and create new Schema objects when necessary.
3rd class is called Config and it holds various shared configurations including information about each new Schema object.
4th class is called View and it simply views Schema information.
Schema objects can be accessed by ID as they are held in a static list.