vendredi 23 mars 2018

Can I have my core logic to update object status in Aspect


I have a requirement where I will be performing a set of operation in a chain pattern ClassA->ClassB->ClassC by invoking common method action(). Ideally ClassA, ClassB and ClassC implements interface IClass having method action().

At the end of action() method, its status(failed/success) should be updated in the Database.
So my doubt is,
- Is it a good design to leverage Aspect's around advice for method "action" and update the status in Aspect class once the action got executed.
- Our since it is core logic to update the action status, it shouldn't be part of cross-cutting framework like aspect?

Aucun commentaire:

Enregistrer un commentaire