This a general question. I am designing a system using the Unit of Work pattern. Are there any established patterns which lays out how to share logic between multiple units of work in a unit testable way?
Here is a more concrete scenario:
There is a PurchaseOrder which
UnitOfWork1 -> submits PO for approval
UnitOfWork2 -> approves or denies PO and sent it back to submitter
Both Unit of works shares same code such as:
ShareLogic1 -> User needs to have access to PO
SharedLogic2 -> Record the last action to PO
What pattern(s) can I use where such logic can be shared between multiple units of work. Though inheritance can solve the problem in this case, I don't want to use inheritance as it won't fit in every case.