Class design for calling "the same method" on different classes from one place
Posted
by
betatester07
on Programmers
See other posts from Programmers
or by betatester07
Published on 2013-10-21T13:54:01Z
Indexed on
2013/10/21
16:08 UTC
Read the original article
Hit count: 239
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
- etc.
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?
© Programmers or respective owner