I have a situation where I must first call my order methods. This has appeared in several places, so I wonder if there is some kind of pattern that I don't see.
Right now, in each such case, I have a stage where I execute some code based on prerequisites , an action stage (where I change my data) and save a scene where I save it in db, I now have this:
accessRightsService.Shift(document, userRole);
updateService.ApplyChanges(document, newData);
documentRepository.Update(document);
I was thinking of something like myService.WrapOperation(doc, d => {})that would first invoke preparation, then execute an action, and then store the results in a database.
So this is a template - and if so, which one?
Not like template method or decorator for me
source
share