jeudi 30 avril 2015

Design pattern approach for operations with shared dependencies

I've been approaching a scenario, where I can't seem to quite encapsulate the logic required for a design pattern. Here's the scenario...

The ubiquitous task example:

  • I have a Task with multiple Steps to completion.
  • Each Step has a status of complete, process, fail.
  • A fail is a hard stop, task is removed.

Step 1: (no parent, two children depend on Step 1 being completed)

Steps 2 & 3: (Require Step 1 to be completed, 2 & 3 can be completed in any order)

Step 4: (Requires Step 2 & 3 to be completed)

I've approached initially the chain of command, but was unable to adapt the sibling steps. Is this situation better described by another pattern? Or adapting the chain of command to mesh with strategy?

Thanks

Aucun commentaire:

Enregistrer un commentaire