Thursday, June 24, 2010

Windows Workflow Foundation (WF) - Benefits And Tutorials

Window WorkFlow foundation (WF) has changed the way we code and manage our applications. It has revolutionized the concept of coding in which one can see the processes and logics involved. In this post I am going to discuss about Window WorkFlow Foundation and its benefits.

Introduction

Everybody who writes code wants to build great software. If that software is a server application, part of being great is scaling well, handling large loads without consuming  too many resources.  A great  application should  also  be  as easy as possible  to  understand, both for its creators and for the people who maintain it.  Achieving both of these goals isn’t easy. Approaches that help applications scale tend to break them apart, dividing their logic into  separate  chunks  that can be hard to understand. Yet writing unified logic that lives in a single executable can make scaling the application all but impossible. What’s needed is a way to keep the application’s logic unified, making it more understandable, while still letting the application scale.

Achieving this is a primary goal of Windows Workflow Foundation (WF). By supporting logic  created using  workflows, WF provides a foundation for creating unified  and scalable applications.  Along with this,  WF can also simplify other development challenges, such as coordinating parallel work, tracking a program’s execution, and more.

WF was first released with the .NET Framework 3.0 in 2006, then updated in the .NET Framework 3.5.  These first two versions  were useful,  especially for independent software vendors (ISVs),  but  they haven’t become  mainstream  technologies  for enterprise developers. With the version of WF that’s part of the .NET Framework 4, its creators aim to change this. A major  goal of this latest release is to make WF a standard part of the programming toolkit for all .NET developers. Like any technology, applying WF requires understanding what it is, why it’s useful, and when it makes sense to use it. The goal of this overview is to make these things clear. You won’t learn how to write WF applications, but you will get a look at what WF offers, why it is the way it is, and how it can improve a developer’s life. In other words, you’ll begin to understand the workflow way.


A workflow based program is like traditional programs that allow you to coordinate work and perform operations but has some important differences:

  • Workflows use a declarative model (see Declarative programming) of writing programs by linking together pre-defined activities rather than an imperative programming model of writing each line of code
  • Workflows can handle long-running work by persisting themselves to a durable store, such as a database, when idle and loading again once there is work to be performed
  • Workflows can be modified dynamically while running when new conditions require a workflow to behave differently than when it was created
  • Workflows provide a distinct separation of business rules and host application code making it easier to modify the business rules
  • Workflows support sequential workflows for systems with sequential logic and state machine workflows for systems with event-based logic
  • Workflows usually have a visual counterpart that allows a flowchart-like description of their logic


Windows Workflow Foundation (WF) provides the declarative framework for building application and service logic and gives developers a higher level language for handling asynchronous, parallel tasks and other complex processing. WF is a set of tools for declaring your workflow (your business logic), activities to help define the logic and control flow, and a runtime for executing the resulting application definition.  In short, WF is about using a higher level language for writing applications, with the goal of making developers more productive, applications easier to manage, and change quicker to implement.  The WF runtime not only executes your workflows for you, it also provides services and features important when writing application logic such persistence of state, bookmarking and resumption of business logic, all of which lead to thread and process agility enabling scale up and scale out of business processes.



A Windows Communication Foundation (WCF) approach to workflow communication was added in .NET Framework 3.5. This functionality comes in the form of two activities, SendActivity and ReceiveActivity, which send and receive WCF messages respectively. Workflows which include a ReceiveActivity expose a selected interface method as a WCF service. This could allow external code to, for example, make a Web Services call to a running workflow instance. The WF Runtime provides infrastructure to ensure that if a WCF call is made to a workflow instance that is in a persisted state (i.e. waiting for some external event like a WCF call or a timer event), then the instance will be reloaded into memory so that the message can be delivered to the workflow instance. Workflows which include a SendActivity are able to call external services via WCF.



Tutorial Videos

A good video explaining the use of WF and its benefits is as follows:



A good video showing how to create a WF project is as follows:




Further Readings


For further reading refer to MSDN article.

28 comments:

  1. Quite a nice post and very informative.

    ReplyDelete
  2. Thanks for video tutorials. It was really helpful.

    ReplyDelete
  3. Hi thanks for this article. I am really trying to justify using WF but I just cannot. The benefits you mention are very high level, the sort of thing a manager would love. However, the actual story is very different, IMHO. In particular, this benefit I have the biggest issue with:

    Workflows provide a distinct separation of business rules and host application code making it easier to modify the business rules

    It's NOT easier to modify business rules in WF, it's harder. You've got stupid events and delegates to wire up, stupid variables and arguments to update. It's slower, cumbersome and much more difficult to track the end-to-end flow of a particular program.

    Using a strictly C# POCO approach, serialization is one line of code anyway!

    Windows WF has ABSOLUTELY no benefit in my opinion, other than to show a manager who hasn't got a clue about technical stuff a pretty picture!

    ReplyDelete
  4. With globalization, the dividing line between ‘local’ and ‘global’ has diminished, as business interests overlap. Companies are making optimum use of the possibilities provided by the web to further the scope of their business.

    .Net Application Development

    ReplyDelete
  5. Great Points was posted.thanks a lot for sharing.

    ReplyDelete
  6. Really interesting content which is unique which provided me the required information.
    Dot Net Training in Chennai | .Net training in Chennai | FITA Training | FITA Velachery .

    ReplyDelete
  7. I really enjoyed while reading your article about windows workflow, the information you have delivered in this post was damn good. Keep sharing your post with efficient news.
    Regards,
    FITA Chennai complaints|Python Training in Chennai|SAS Training in Chennai

    ReplyDelete
  8. Thanks Admin for sharing such a useful post, I hope it’s useful to many individuals for whose looking this precious information to developing their skill.
    Regards,

    Salesforce Training in Chennai|Salesforce Training|Salesforce Training institutes in Chennai

    ReplyDelete
  9. Excellent post!!!. The strategy you have posted on this technology helped me to get into the next level and had lot of information in it.


    Dotnet Training in chennai

    ReplyDelete
  10. The blog gave me idea about the windows workflow this post foundation My sincere Thanks for sharing this post
    Dot Net Training in Chennai

    ReplyDelete
  11. really you have posted an informative article. so keep on sharing such kind of an interesting blogs. before i read this blog i didn't have any knowledge about this but now i got some knowledge.
    dot net training in chennai

    ReplyDelete
  12. I may be crazy but, the idea has been nagging me for some time that perhaps the biggest favor we could do for the African poor would be to kill off all that dangerous wild life. Software Testing Training in Chennai | Big data Analytics Training in Chennai

    ReplyDelete
  13. https://jai-on-asp.blogspot.com/2010/06/windows-workflow-foundation-wf-benefits.html?showComment=1573025755755#c6040261645166686204

    ReplyDelete

Comments to this post

LinkWithin

Related Posts with Thumbnails