Workflow Factories

Editor
Mar 8, 2011 at 4:50 PM
Edited Mar 8, 2011 at 5:15 PM

In my own project I have created a concept of a workflow factory. Its not a static class, it's sole purpose is to make workflow definition simpler and more isolated. The gist linked to below contains my exact code.

https://gist.github.com/860519

Do you think ObjectFlow would benefit from including an abstract factory class like this? I'm using it with Castle to keep everything separated. While it's not crucial to the usage of OF, maybe it would be helpful in separating OF from the other [ultimately overcomplicated] workflow frameworks?

Coordinator
Mar 8, 2011 at 7:24 PM
Edited Mar 8, 2011 at 8:45 PM

Is it doing a similiar job as the abstract class I implemented recently;

http://objectflow.codeplex.com/wikipage?title=AsAWorkflow%3CT%3E&referringTitle=API%20Documentation

The intention I think is similiar; to encapsulate workflows and allow polymorphism. 

One thing I noticed about your implementation is that it is not just a factory as it Starts the workflow as well (as does mine).

I can see how I can improve mine by borrowing from yours - I prefer the idea of the process method calling Define() rather than how I'm setting a protected property.  

I've deprecated my original;

Configure(IDefine<T> workflow)

in favour of your;

IWorkflow<T> Configure().

Editor
Mar 8, 2011 at 8:46 PM

So besides sharing ideas, would you be interested in moving something like this into the core, or into the Helpers namespace?

Coordinator
Mar 8, 2011 at 8:57 PM
Edited Mar 8, 2011 at 9:23 PM

I think the AsAworkflow<T> abstract class is doing almost exactly the same as your implementation. Take a look at the latest revision and let me know if it can be improved.  I've been playing around with this for the last few days.

It's also in the latest beta release.  

We'd probably want something similiar for the stateful workflow, following the same pattern. This should probably be in the Stateful project rather than in core.