Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Design pattern for workflow

Tags:

c#

workflow

I don't think this is a duplicate but I actually need some one wise to confirm my question.

My pattern is going to be similar too (albeit much more complex) the picture below (where my application starts from top to bottom).

It takes a complex object as part of the constructor and then goes through various processes (saved in different .dlls).

I've not taken on a project like this before and want to get it right - I know design patterns are designed to help and give guidance.

enter image description here

My question, what patterns could work. I am stuck on .NET 2.0. My research suggests sequence pattern.

So, am I limited to only the sequence pattern or does any one have another other suggestion?

like image 971
Dave Avatar asked Sep 17 '12 14:09

Dave


1 Answers

I have written similar code, but not just with a single pattern. Initially my approach was to code all in Transaction Script pattern and then refactor. During refactoring I came across follwings;

  1. Template pattern: Decoupled logic to seperate classes which I called an Activity (similar to WF), and these Activity classes behaved similar way and therefore used Template pattern.
  2. Transaction Script pattern: An Activity itself is a Transaction Script and could accept Arguments, has a Fault property, and Results which it will be used, construct, stored during the execution.
  3. Builder pattern: To wire up all the Acitivity classes for the business scenario, I ended up with Builder pattern.
like image 70
Kosala Nuwan Perera Avatar answered Nov 09 '22 12:11

Kosala Nuwan Perera