jeudi 1 juin 2017

Java - Send a method as parameter and decide if there is need to call it

I am currently making an app and I am implementing cache in it. The thing is the DAOs are implemented in another service. The idea that I had, to avoid code repeating, is having a generic cache in my service. Then, acording to the method called it verifies the respective cache and, in case it doesn't exist, calls the DAO associated with the method passed as parameter. Is there any way to do this? NOTE: I am using java 1.6 in my application

Aucun commentaire:

Enregistrer un commentaire