Home > Software engineering >  Which design pattern to use for pre-process process and post-process task
Which design pattern to use for pre-process process and post-process task

Time:03-23

I am working on one migration engine to migrate data from older system to newer system. it is divided into 3 steps.

  1. first getting the data from older tables.
  2. prepare the request body to insert into new tables via APIs
  3. post processing steps.

Which design pattern to use here?

I was thinking of using builder pattern

CodePudding user response:

Here you already have pre-defined and definite steps to perform. In this case template design pattern works well.

Sequence of calling steps are fixed and Responsibility of each steps can be seggregated into separate classes and finally can be linked on template management class.

Refer this link - https://refactoring.guru/design-patterns/template-method

CodePudding user response:

I think you might want to go for a Pipe-Filter Pattern here as an overall design. What you describe is pretty much described here.

  • Related