I know there has been a lot of discussion around Workflow Foundation (WF) and CSLA on this forum and I don't want to rehash all of that. But... I do have to make some design decisions for a current application and could use some insights to help steer me one way or the other.
From my perspective, WF can serve one of two purposes:
I find the latter fits into CSLA, OOP et al much better because WF manages activities that work with or on our business objects. The workflow activities are no different than any other object we collaborate with in our applications and provide the glue that makes a set of business objects into an application.
Let me use the example of a service method called PrintReport. A client calls this method, passing in the report name and number of copies to print, to trigger the printing of a pre-defined report on the server. In order to perform this operation, I must execute the following steps:
Most of these steps are also used when executing other service methods so I immediately recognized the need to encapsulate them in objects that can be shared across operations. This could take the form of WF activities or simple command objects.
The question is whether WF is really a good fit? My concern mostly stems from the performance impact of having a workflow engine running versus having command objects that are bound together to orchestrate the workflow. For instance, I could have a PrintReportCommand object that uses other command objects representing each step in the workflow and simply be done with it.
On the other hand, WF is a very flexible and convenient way to implement such orchestration. However, I don't see my workflow changing much so, again, is it worth it to implement WF?
Finally, I will be exposing my services via WCF and I know WCF and WF play very well together. But, one more time, is it worth it?
Please share your thoughts and experiences - I appreciate the guidance.
The primary benefits of WF for orchestration are
I'm a strong believer in only using a technology, any technology, if I clearly need the benefit(s) it provides. This is because every technology you add to your app increases complexity, increases the learning curve for developers and increases fragility (one more thing can break).
So you need to ask yourself if you need any of these benefits. If you do, then decide if the benefit outweighs the costs. If it does, then go for it.
Copyright (c) Marimer LLC