Sunday 30 August 2009

Windows Workflow Foundation

During my research into Windows Workflow Foundation I discovered many things, the most important discoverey of all was the actual reason for using it. This was probably the most difficult aspect of my research, but after hours of heading banging and implementation I found several good reasons for using Windows Workflow Foundation (WF).

Image a scenario where you have been given the developement task of building a specific aspect of an application. Here you are responsible for only one part and other members of the team are responsible for the other aspects, for example, you have been told to build a function that takes text and determines whether or not the word "Microsoft" appeared within the text. So most likely you build your simple application which uses a regular expression (of some kind) and returns some kind of boolean.

Now what happens to that boolean that is return you have no idea, nor do you know where the text comes from. All you know is that your function works! Now the project manager has thanked you for your working function and has reveiled to you how integral your function is to the company's applications. In fact he has told you that several existing applications and several new ones will be using your function in order to determine some kind of process, for example, one application may use your function to send emails to every address where "Microsoft" is in the domain.

Achieving this portability can be done in many ways, however using WF it can be achieved in a strongly-typed diagrammtic way. All this means is that you can view the various execution processes whislt it being tied into the code. Before this had to be done seperately with the business processes being dis-connected from the code, with WF however, this business logic achieved through a UML designer is built into to the .NET framework allowing true business logic to be programmed directly into the application logic.

So to go back to the inital problem, a team-lead or manager can easily integrate other applications or remove exisiting applications by using the WF. He can also ensure that your function is doing what its supposed to be doing by simpliy integratin unit tests and making sure that the application exits correctly!

Perfect, problem solved you work on your existing code whislt it gets integrated seemlessly with everything else!!