I'm working on a small scale API project but as it will be used and maintained by people that are not Software Engineers to trade I am attempting to keep the design as separate and identifiable as possible, using SOLID has made this easier.
But a few of my objects require to change (say made "active") which then in turn should make the other object that was "active" now disabled. This is simply a property of the object. This requires me to still know about all the objects even after they have been returned to the user.
So I've thought up that I can use an "Object Store" which will store the object's created before they are actually returned to the user of the system, but I'm unsure where in my pattern of creating objects that this sits. I've added an image below that shows how the objects are created within my solution.
So within my solution the controller get's the necessary properties to build an object (this may include interfacing externally but I've missed this out my diagram). This passes the arguments to the factory that then actually builds the object.
So I was thinking of adding to my "object store" in the controller after it has requested the factory to build the object, but the issue with this is that it then means that the controller will be responsible for, getting the necessary arguments and storing the created objects.
I was also thinking that it could be placed between the controller and the factory so that the controller said "GetObject" on the "object store" and this could save it internally but this then means that the object store won't just store objects it will also request for them to be built.
Is there any pointers on where this could sit and why? Perhaps my pattern for creating objects is incorrect (seems to have been OK up to now)?
Specifics so what I am doing is an adapter that sits over the ActiveX interface of Third-party software that my Company uses. This will be used as an API by other "engineers" within the company for automating tasks that the third party software does. As object "X" in my example returns a collection of "Y"'s I am looking for a method of changing a property on the other Y's when one changes, like a "active" flag, one is made active the current active is dis-activated. I don't know how much more specific I can be without saying exactly what the application is or does.