0% found this document useful (0 votes)
67 views10 pages

Windows Workflow Foundation

The Windows Workflow Foundation provides a platform for building workflows using .NET. It allows for visual representation of processes, dynamic modification at runtime, and long-running workflows. Workflows can be built declaratively using markup or code, and can be hosted on applications like Windows Forms. Workflows consist of activities and use services, and support long-running, compensating, and tracked workflows. Rules and conditions can be applied to workflows. The Windows Workflow Foundation differs from BizTalk Server in that it is a platform for developing workflows within applications, while BizTalk Server is a server product for business process automation.

Uploaded by

Krishna kurdekar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
67 views10 pages

Windows Workflow Foundation

The Windows Workflow Foundation provides a platform for building workflows using .NET. It allows for visual representation of processes, dynamic modification at runtime, and long-running workflows. Workflows can be built declaratively using markup or code, and can be hosted on applications like Windows Forms. Workflows consist of activities and use services, and support long-running, compensating, and tracked workflows. Rules and conditions can be applied to workflows. The Windows Workflow Foundation differs from BizTalk Server in that it is a platform for developing workflows within applications, while BizTalk Server is a server product for business process automation.

Uploaded by

Krishna kurdekar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

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.

Some of the major criteria for workflows are listed below:

1. Visual Representation of process(es)


2. Can be dynamically modified at run-time
3. Can be long-running
There are two major types of workflows -

• Sequential workflows: used for well-defined, process workflows


• State Machine workflows: Organized as state machine diagrams, typically used for
workflows with human interaction.

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.

Compensation: Transactions in the workflow world are different compared to traditional


transactions. In cases where we have long running workflows, it may not be possible to exactly
"rollback" a set of steps when an exception occurs. Instead, the workflow allows "compensation"
which in simple terms is the action taken to cover up for the effect of the part of the transaction
that has already been completed.

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.

Windows Card space


These days our online lives look a lot like our offline lives. We hang out with our friends. We shop. We’re
entertained. So, just as you wouldn’t leave your house without your driver’s license or other identification
card, it makes sense that you need a similar information card to use online.

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.

There are three types of scopes in C#.

• Class Level Scope


• Method Level Scope
• Code-Block Level Scope

Class Level Scope


A variable declared within a class is known as a field. It has a class-level scope that can be
accessed anywhere in the class, such as class methods, properties, etc.

Class Level Variables Scope


class Student
{
private string _firstName = "Bruce";
private string _lastName = "Lee";

public void DisplayFullName()


{
Console.WriteLine(_firstName + " " + _lastName);
}

public string FullName


{
get
{
return _firstName + " " + _lastName;
}
}
}

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.

Method Level Scope


A variable declared within a method has a method level Scope. It is also known as a local
variable of the method where it is declared. It cannot be accessed outside the method.

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.

The following example shows the method Level scope:

lass Program
{
static string str = "Hello";

static void Main(string[] args)


{
//Method level scope of variable declaration
int a = 20;
Console.WriteLine("a = {0}", a);

//can access class level variables


Console.WriteLine("str = {0}", str);

Process();
// Console.WriteLine("b = {0}", b); // can't access b
}

static void Process(){


int b = 30;
Console.WriteLine("b = {0}", 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.

Code-Block Level Scope


A variable declared within a loop or any block within brackets has the code-block level scope. A
variable declared within a loop or code block cannot be accessed outside of it, whereas a variable
declared outside of the loop can be accessible within the loop.

class Program
{
static void Main(string[] args)
{
int count = 0;

for (int i = 0; i < 5; i++)


Console.WriteLine(i);

//Console.WriteLine(i); //can't access i because it has loop level


scope

if (count == 0)
{
count++; //can access method variables

int x = 10; //declared block level variable


}

//Console.WriteLine(x); //can't access block level variable


}
}

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 {

// Namespace (Nested Namespaces)


// Classes
// Interfaces
// Structures
// Delegates

Example:

// defining the namespace name1


namespace name1
{

// C1 is the class in the namespace name1


class C1
{
// class code
}
}
Accessing the Members of Namespace

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:

// C# program to illustrate the

// use of namespaces

// namespace declaration

namespace first {

// name_1 namespace members

// i.e. class

class Geeks_1

// function of class Geeks_1

public static void display()

// Here System is the namespace

// under which Console class is defined

// You can avoid writing System with

// the help of "using" keyword discussed

// later in this article

System.Console.WriteLine("Hello Geeks!");

}
/* Removing comment will give the error

because no two classes can have the

same name under a single namespace

class Geeks_1

} */

} // ending of first namespace

// Class declaration

class Geeks_2

// Main Method

public static void Main(String []args)

// calling the display method of

// class Geeks_1 by using two dot


// operator as one is use to access

// the class of first namespace and

// another is use to access the

// static method of class Geeks_1.

// Termed as fully qualified name

first.Geeks_1.display();

Output:

Hello Geeks!

In the above example:

• In System.Console.WriteLine()” “System” is a namespace in which we have a class


named “Console” whose method is “WriteLine()“.
• It is not necessary to keep each class in C# within Namespace but we do it to organize our
code well.
• Here “.” is the delimiter used to separate the class name from the namespace and function
name from the classname.

Common Type System (CTS) in .NET

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.

How CTS converts the data type to a common data type

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.

You might also like