mardi 24 octobre 2017

AbstractFactory DP or Builder DP?

I am a beginner in design pattern. I did some practice to improve my skills in this subject, but I am stuck now in this problem.

I cannot figure out which Design pattern suits more for this pattern:

I would create an object that its creation takes many steps. The process is described like that:

  1. The workflow receives a json string data like this {"jws": "some data"}
  2. It derserialize the data and get a value of jws attribute
  3. This value passes a validation process that its output is another json data (extracted from the jws attribute)
  4. This new json data is deserialized as "T" object

Another workflow is described like that:

  1. The workflow receive an object data
  2. It passes a validation process that return a string value
  3. This value is transformed to another type (dict as an example)
  4. Return the new value

I was thinking about AbstractFactory DP and Builder DP but I did not find how to model it.

I am using C# as programming language and ASP.NET Core

The instantiation of the 2 workflow it will be handle by dependency injection later

Aucun commentaire:

Enregistrer un commentaire