DCSIMG
2009 is a good time to reinforce your Workflow Foundation - Part 1 - yairs

yairs

2009 is a good time to reinforce your Workflow Foundation - Part 1

The following “Workflow Foundation” articles are aimed for Software architects and developers that want to find out what is the big promise held inside Windows Workflow Foundation (WF), how this technology can help them design and write a better solutions and when is the right time to move in? Well, you are probably all heard about the Microsoft’s Windows Workflow Foundation (WF) that was released back on November 2006 as part of .Net 3.0. A year later on October 2007 Microsoft has indicated that workflows are going to be a cornerstone of the future Service Oriented Architecture platform. A year later at PDC October 2008, we all got to see the proof looking into the 2010 bits showing clearly that most investment and innovation is taking place in the Workflow Foundation area. Workflows, like traditional programs, allow you to coordinate work but have some important differences.
  • Workflows can handle long running work by persisting to a durable store, such as a database, when idle and loading again once there is work to do
  • An instance of a workflow can be modified dynamically while running in the event that new conditions require the workflow to behave differently than it did when it was created
  • Workflows are a declarative way of writing programs by linking together pre-defined activities rather than an imperative programming model of writing lines of code
  • Workflows allow you to declare business rules that are separated from your code making it easier for you to modify them in the future
  • Workflows support different styles of systems with sequential and state machine workflows
In this article I would like to focus on the first feature described as “Workflows can handle long running work by persisting to a durable store…….”To understand the above feature lets first look into the following three programming tasks. ·         Synchronous programming.·         Asynchronous programming.·         Truly Asynchronous programming (Messaging).Every programmer knows how to write lines of code that runs synchronously one line after the other.  The second task, Asynchronous programming, is also an easy task while working in a managed code environment like Microsoft .Net Or J2EE. All you need to know is how to generate new threads how to synchronize them, maintain handlers and work with critical sections and deadlocks. However, Truly Asynchronous programming (messaging) is much more difficult task and here is where WF comes to the rescue. To better understand this lets look into the following scenario.You need to design and implement an application that will collect information from services that some or all of them my need a “long time” to response. You do not want to keep your program state in memory while waiting for service functions to callback.  Asynchronous programming will not really solve the problem as you continue to wait in memory just on another thread. Your problem is the time-out exception you may get and/or the resources being wasted while waiting for the service functions to complete and call back.  The solution for this problem is known as “Truly Asynchronous Programming” or “messaging”. In practice, you may want to modify the service functions to return nothing (VOID). An advance scenario will make sure that a message is sent “one way” to the service without waiting for any result or callback (unless there is an error in the transport).  After calling the one way function (sending a message) you may want to release the state from memory and turn it idle so it is available for any other need. Then, after a while, the service you called is ready with results to be sent to you. A response message is calling in your program and wakes it up from its idle mode. At this point you need to know who is calling you, where the specific state is kept, how to serialize it, and is it still relevant at all. The good point is that now you may set the time-out according to the business needs ranging from seconds to months. The time-out is no longer a problem you need to solve.  Remember, working with messaging in a truly-asynchronous fashion is not necessarily slower than using Request-Response function calls.  The enterprise world is already using this architecture for a long lone time.  Workflow Foundation makes it easier to use this powerful architecture having one design to handle short term as well as long term responses. On February 8 and 9, 2009, I will give a two days course on the “Windows Workflow Foundation”. The course will take place at Hi-Tech College.  The course will run according to the official Microsoft curriculum and in addition to it we will practice scenarios like the one discussed in this article. Sample code will be published soon.... Part 2.Thanks,

Yair Siwek

תוכן התגובה

2009 is a good time to reinforce your Workflow Foundation - Part 1 ... | Bad SOA כתב/ה:

Pingback from  2009 is a good time to reinforce your Workflow Foundation - Part 1 ... | Bad SOA

# January 20, 2009 10:45 PM

Arnon Rotem-Gal-Oz כתב/ה:

If anything 2009 is a year to sit on the fence until MS will finally get their act together in regards to WF

See also the following post by  Tad Anderson:

realworldsa.blogspot.com/.../good-bye-windows-workflow-foundation.html

# January 21, 2009 12:04 AM

PiterKokoniz כתב/ה:

Hello ! ^_^

I am Piter Kokoniz. Just want to tell, that I'v found your blog very interesting

And want to ask you: what was the reasson for you to start this blog?

Sorry for my bad english:)

Tnx!

Piter.

# April 8, 2009 3:32 AM
שלח תגובה

(שדה חובה)  

(שדה חובה)  

(אופציונלי)

(שדה חובה) 

Please add 3 and 5 and type the answer here:


Enter the numbers above: