dimanche 19 avril 2015

How to run a method before some special methods?

In my business, I have to execute a method (imagine an access controll-like method) before some special methods(e.g. save, update,etc) to check some prerequisites and then execute the intended method. It is obvious that the most simple way is to call that controlling method at the very beginning lines of those methods, but I'm looking for something like @Before. something clean. Any answer/hints will be appreciated.


Aucun commentaire:

Enregistrer un commentaire