I have twenty small methods (m1
, m2
, m3
, etc..) in a class quite different between each other, and after every method i would like to do some common actions, like increasing some counters and in the case write those counters to a file. Let's call those actions ACT
.
I know that I can create a method that does ACT
, but then I need to call it from every other method. That is, from m1
I should call ACT as last method, from m2
I should call ACT
as last method, and so on.
Is there a way to say "if someone call this list of methods of this class (i.e: m1
, m2
, m3
...), please after that call that method (i.e: ACT) automatically" ? Because AFAIK is not possible.