"Translation Exercises" Windows Workflow Foundation Program Development-Chapter 02

Source: Internet
Author: User

1.2 Windows Workflow Overview

Microsoft's Windows Workflow Foundation (WF) is part of the. NET Framework version 3.0. The other major parts of NET3.0 are Windows Presentation Foundation (WPF) and Windows Communication Foundation (WCF for short). Microsoft will provide support for WF in Windows Xp,windows Server 2003 and Windows Vista operating systems.

WF is now and in the future supported by the Microsoft operating system platform, which is likely to create a situation where WF can be used in a long-term and widespread manner. We can apply WF in smart client software and simple console programs. We can also apply WF in server-side software, which includes Windows services, ASP. NET Web applications and Web services. WF will also appear in several products that Microsoft has developed on its own, such as Windows SharePoint Services and Microsoft Biztalk Server. Now, let's look at some of the essential features of WF.

1.2.1 Activities

Activity is the basic component in WF. Activities constitute individual steps or tasks in a workflow that implement the definition of a workflow. We can organize multiple activities hierarchically and then input them as directives to the workflow engine to execute. Activities can affect the execution path of a workflow, and both people and software systems are involved.

All activities in WF inherit from the activity class. The activity class defines common operations that all activities in the workflow have to have, such as the Execute and cancel methods. This class also includes definitions of common properties, such as the name and parent properties, as well as definitions of common events such as executing and closed events (which, when an activity is executed, raises the closed event). The screenshot below shows the activity class seen in Visual Studio 2005 Class Designer.

WF provides users with a series of prefabricated activity modules in the form of a basic activity library. There are simple activities in the base Activity library, such as control flow operations such as ifelseactivity and whileactivity, which developers can use as a basis for building complex activities. The basic activity library also includes more activities, some of which can wait for events, some to invoke Web services, some to execute rules engines, and so on.

1.2.1.1 Custom Activities

Windows Workflow allows developers to extend the functionality of the base Activity library by creating custom activities that address specific areas of the problem. For example, to improve the efficiency of the pizza delivery process, we can use custom activities like Sendordertokitchen or Notifycustomer.

All custom activities will eventually inherit from the activity base class. When the workflow engine executes an activity, it does not differentiate whether it is provided by Microsoft or by a third party.

We can use custom activities to build a domain-specific language specifically designed to create a workflow solution. Application of domain-specific languages can greatly simplify the problem space. For example, we can customize a sendordertokitchen activity and use it to encapsulate a Web service invocation with other processing logic. This activity is clearly customized for the restaurant problem domain. Using this high-level abstraction for development is bound to improve programmer productivity when compared to simple activities in the base Class library. Even a restaurant manager understands the meaning of sendordertokitchen and is likely to be used in a visual workflow designer. If you hear that a restaurant manager is more inclined to use whileactivity and invokewebserviceactivity activities, it's only weird!

C#,vb. NET and XML are common languages and can be applied to many fields to solve different types of problems. So we use C # for both pizza restaurants and hospitals to write software, and C # is equally capable of meeting the development language requirements of these two areas. Domain-specific languages can provide an excellent solution for problems in a specific domain. If you use a restaurant to write software for a restaurant in a specific language, then this software may improve the productivity of the restaurant, and if you use this language for the hospital development, then no one dares to package the application effect of the software.

"Translation Exercises" Windows Workflow Foundation Program Development-Chapter 02

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.