Standard Singleton and Prototype

0

I'm developing a project where I came across the following situation: There are two families of algorithms that use a given object in different ways: the first just read the data and do a processing, the second one modifies the object.

My problem is: this object that these families are extremely large and takes a lot of time to read the information in memory, so getting this object all the time will be a problem.

I know for the family that just reading the data, the singleton could be a solution and already for the modifying family could use the prototype.

I wanted to know if it's possible to combine these two patterns, since I'm using an abstract factory and I'm not sure if to determine which one to use at runtime (for each of the families).

    
asked by anonymous 27.09.2018 / 13:55

0 answers