I have a use case where I need to process a request as follows
- Authenticate the Request
- Authorize the Request
- Validate the message (Reads the database for the existing record and validates it)
- Perform some asynchronous operations
- Update the records in the database and notify the customer
The problem is I need to read the same record we read in step 3 in step 4 and step 5 Since this looked like a workflow I thought I can use the COR design pattern. However I do not want to read the database record again in step 4 and 5 and want to pass this from step 3 to step 4 and 5.
What is an elegant design pattern I can use for this workflow. Can you help me with giving some class/interface structure for this?