mercredi 20 juin 2018

Design pattern for a sequence of related operations

I have a use case where I need to process a request as follows

1) Authenticate the Request 2) Authorize the Request 3) Validate the message (Reads the database for the existing record and validates it) 4) Perform some asynchronous operations 5) 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?

Aucun commentaire:

Enregistrer un commentaire