Windows Workflow Foundation
Windows Workflow Foundation
The Windows Workflow foundation provides a platform built on the .Net Framework for building
workflows. It is not an application or a server product, and is included as a component of the .Net
3.0 framework. The platform unleashes the power of a completely different paradigm.
Workflows can either be built declaratively by using only Markup, or only Code or a combination
of both Markup and code.
Once the workflow is developed, it can be hosted on any application that can load the Workflow
Runtime such as Windows Forms, Windows Services, ASP.Net Web Sites and Web Services.
Activities: Workflows consist of one or more activities. Activities are the building blocks of
workflows. A set of pre-built activities is provided for developers. You can also build your own
custom activities.
Services: The workflow runtime engine uses many services when executing a workflow instance.
You can either use the services in the Windows Workflow Foundation, or you can customize the
available services, or you can build your own services.
Long Running Workflow: Workflows in real life can have a long and unpredictable execution
life. The Windows Workflow Foundation handles this capability and can persist workflows, as
required.
Tracking: The visual nature of a workflow definition leads us to the next requirement, which is -
tracking the progress of a running workflow. Windows Workflow Foundation provides the
Tracking services to track the status of workflow instances.
Rules and Conditions: You can apply logical conditions in 2 ways in workflows
1. Specify Code Conditions: programmatically define whether certain paths of the workflow
are run. This is similar to specifying a condition in an If Statement, in traditional
programming.
2. Rules: programmatically or declaratively define the business rules for workflows.
Rules allow complex forward chaining rule sets and lend towards easy modification at
runtime. Rules also enable the separation of Business logic and Process flow and can be
shared across workflows
Windows Workflow Foundation vs. BizTalk Server
One of the most common questions for those new to Workflows is, how does this technology
differentiate from BizTalk Server. Windows Workflow Foundation is a platform for developing
workflows within applications. BizTalk Server is a server product targeted for business process
automation.
It helps you control your digital identity, which helps make online activities (like shopping and
social networking) safer and more efficient.
Windows CardSpace was developed by Microsoft as a software program for the Identity
Metasystem. CardSpace was used to create digital identities for users, storing some personal
information about them that could be requested and accessed by websites or other software
applications. Users also had the ability to create personal cards as well, utilizing up to 14 fields
to store information.
When users' information, or identity, was requested, the CardSpace UI would appear, looking
somewhat like a business card or Outlook Contact with information about the user. The user can
select what card to make available to a website or application, which results in the website or
application requesting a digitally signed XML token. This token would then contain the
information being requested about the user.
Microsoft originally included Windows CardSpace with the .NET Framework 3.0, which was
designed to run on Windows XP, Windows Vista and Windows Server 2003. It is installed by
default on Windows Vista and Windows 7, and can be downloaded for Windows XP and
Windows Server 2003 for free. Microsoft has since discontinued Windows CardSpace, opting to
put time and resources into developing a replacement call U-Prove.
Scope of Variables
In C#, the Scope of the variable determines the accessibility of the variable to a particular part of
the application. Variables can be declared within the class, method, and code block of a loop,
condition, etc.
n the above example, the Student class contains two class variables (a.k.a. fields) _firstName
and _lastName. These fields can be accessed anywhere within the class, i.e., within any non-
static methods and properties.
The class level variables can also be accessed out of class using class objects depending on the
access modifiers. The static variables of the class can only be accessed from the static methods
or properties.
Any nested code blocks within the method can access this type of variable. It cannot be declared
twice with the same name within the same scope.
The local variable's scope ends when the method execution completes, and they will be collected
by the garbage collector.
lass Program
{
static string str = "Hello";
Process();
// Console.WriteLine("b = {0}", b); // can't access b
}
//can access cl
In the above example, the Main() method can only access variables declared in the Main()
method but not variables of other methods. In the same way, the Process() method cannot
access variables declared in the Main() or any other method.
class Program
{
static void Main(string[] args)
{
int count = 0;
if (count == 0)
{
count++; //can access method variables
Namespace
In the above example, a variable i declared within a for loop. So, it can only be accessed within
the for loop block and cannot be accessed outside for loop. In the same way, x is declared within
the if block, so it can only be accessed in that block but not outside of it.
A variable must be declared outside of the code block to make it accessible to outside code.
Namespaces are used to organize the classes. It helps to control the scope of methods and classes
in larger .Net programming projects. In simpler words you can say that it provides a way to keep
one set of names(like class names) different from other sets of names. The biggest advantage of
using namespace is that the class names which are declared in one namespace will not clash with
the same class names declared in another namespace. It is also referred as named group of classes
having common features. The members of a namespace can be namespaces, interfaces,
structures, and delegates.
Defining a Namespace
To define a namespace in C#, we will use the namespace keyword followed by the name of the
namespace and curly braces containing the body of the namespace as follows:
Syntax:
namespace name_of_namespace {
Example:
The members of a namespace are accessed by using dot(.) operator. A class in C# is fully known
by its respective namespace.
Syntax:
[namespace_name].[member_name]
Note:
• Two classes with the same name can be created inside 2 different namespaces in a single
program.
• Inside a namespace, no two classes can have the same name.
• In C#, the full name of the class starts from its namespace name followed by dot(.)
operator and the class name, which is termed as the fully qualified name of the class.
Example:
// use of namespaces
// namespace declaration
namespace first {
// i.e. class
class Geeks_1
System.Console.WriteLine("Hello Geeks!");
}
/* Removing comment will give the error
class Geeks_1
} */
// Class declaration
class Geeks_2
// Main Method
first.Geeks_1.display();
Output:
Hello Geeks!
The Common Type System (CTS) standardizes the data types of all programming languages using
.NET under the umbrella of .NET to a common data type for easy and smooth communication
among these .NET languages.
To implement or see how CTS is converting the data type to a common data type, for example,
when we declare an int type data type in C# and VB.Net then they are converted to int32. In other
words, now both will have a common data type that provides flexible communication between
these two languages.
CTS converting data type to Common type for both programming languages
Hence we can clearly see how the .NET Framework is converting the data type to a Common Type
System, so it is a flexible communication among languages that are compliant with .NET
Framework. I hope this article was helpful and it is easy to understand the concept of CTS and
how using “ILDASM” we figured that the Common type System helps to bring the data types of
all programming languages to a common type.