Let me introduce my situation:
I have Java EE application and in one package, I want to have classes which will act primarily as cache for some data from database, for example:
- class that will hold all articles for our website
- class that will hold all categories
Every class should have some
update() method, which will update data for that class from database and also some other methods for data manipulation specific for that data type.
Now, I would like to call
update() method for all class instances (there will be exactly one class instance for every class) from one place.
What is the best design?