I have a set of annotations which are used for tracking failures/success of a function.
Now, there is a class A which has a function f(). This function needs to be invoked for different business use-cases.
What is the right way to track failures/success per business use-case basis? One of the possible approach can be creating separate classes (per use-case) extending class A. These classes will override the f() and call the implementation of super. Now, the required annotations can be putted in these implementation.
However, taking this approach will cause creation of unnecessary classes/object just for tracking purposes.
What is the right way to solve this?