Friday, November 2, 2007

Framework 3.0

Framework 3.0

What is the Microsoft .NET Framework 3.0?

The Microsoft .NET Framework 3.0 (formerly WinFX), is the new managed code programming model for Windows. It combines the power of the .NET Framework 2.0 with four new technologies:

  • Windows Presentation Foundation (WPF)

  • Windows Communication Foundation (WCF)


  • Windows Workflow Foundation (WF), and


  • Windows CardSpace (WCS, formerly "InfoCard").

Use the .NET Framework 3.0 today to build applications that have visually compelling user experiences, seamless communication across technology boundaries, the ability to support a wide range of business processes, and an easier way to manage your personal information online. This is the same great WinFX technology you know and love, now with a new name that identifies it for exactly what it is – the next version of Microsoft's development framework.

Framework 3.0 Architecture:





  • Windows Workflow Foundation (WPF):

What is Workflow?

In the business world, workflow is how an item is moved from one person to another through a process. That process is the business process, and it defines the steps necessary to complete a piece of work. Steps in the process can be required or optional. For example, a business process for a vacation request might be that the employee must provide some information, such as the dates requested, to his or her supervisor. Then, the employee's supervisor must determine if the employee has vacation time to use, and if the date or dates requested are available for vacation.


The supervisor must provide the date information to the human resources department. Finally, the human resources department verifies that all policies have been followed, and provides the information to accounting at the appropriate time so payroll adjustments can be made. Notice that I didn't mention technology in my explanation of the business process. Business processes should be defined absent of technology. However, you can see there's a flow to the work. Also, notice that at several points in the flow, decisions need to be made. For example, the supervisor must make sure the employee has vacation time to use, and the company might have specific requirements about the number of employees that can be on vacation at the same time within a department. Because the flow can't move from one step to the next without some criteria being met, this is a state-based workflow. A state-based workflow means that each step of the flow has criteria that must be met before the flow can continue to the next step.


A state-based workflow waits on external entities to perform some action before moving to the next step. This example of workflow has a large amount of potential branching. Within a workflow, branching is when a decision needs to be made, such as when the supervisor must determine if the employee has enough vacation time to use, and if company policies related to staff size within a department will be met. In this case, two decisions need to be made: first, if the employee has vacation time to use, and second, if policies have been met. For each branch in a workflow, there must be at least two alternatives. You can't have a workflow just stop at a decision point.


Another type of workflow is sequential. Sequential workflow is a workflow whose steps are performed one right after the other, but might include branching. In this case, sequential refers more to continuous operation, instead of the order in which actions are performed. The traditional concept of sequential in programming is without branching, but when related to workflow, sequential means continuous, instead of without branching. Steps in a Sequential workflow don't wait for an external entity to perform the next step. You can think of the Sequential workflow as close to continuous. There might be some external entity's action required to begin the flow, but once the flow is started, little if any external action is needed. Technology must be applied to a business process. For example, you might have a process that automatically updates a sales order as complete, and sends an e-mail notice to the customer and the sales person when a sales order is shipped. An external entity must start the process by saying that the sales order has shipped, but then some system would mark the sales order as complete, determine the customer's e-mail address, determine the sales person's e-mail address, and then send the e-mail. Once an external entity initiates the flow, the flow continues until an exception is encountered or the flow is completed.


Introducing Windows Workflow Foundation (WWF):


Windows Workflow Foundation (WF) is a technology that Microsoft has packaged with the .NET Framework for Microsoft Vista. WF is part of the programming model for Microsoft Vista, the next release of the Windows operating system. The new name for that programming model is WinFX, and it's a significant expansion of the Microsoft .NET Framework that was first released several years ago. Although WF is part of the WinFX programming model for Windows Vista, it can be run on clients that have Windows Server 2003 SP1, Windows XP SP2, Windows XP Home Edition, or Windows XP Media Center Edition. To develop workflow applications, you must be using Visual Studio 2005—any version except express. You can build workflow applications using VS2005 by adding the Visual Studio 2005 Extensions for Windows Workflow Foundation.


Architecture of Windows Workflow Foundation:

WF itself is a programming model, along with an engine and a set of tools for building workflow enabled applications. The programming model is made up of exposed APIs that other

Programming languages can use to interact with the workflow engine. These APIs are encapsulated within a namespace called System.Workflow. That namespace will be part of the WinFX programming model, but can also be installed as an add-on to the existing .NET Framework 2.0.


The easiest way to interact with the new APIs and namespace is through the Workflow

Designers, which you can add onto VS2005. You must download and install WF (more on this

In the next section) unless you're using Windows Vista as your operating system. When you download and install the foundation, WF gets bolted onto the .NET Framework 2.0 and VS2005. Within VS2005, you'll have new project types and will be able to import and use the System.Workflow namespace. The new Workflow Designer projects allow you to design workflow visually using the same drag-and-drop methods you use for creating Windows or Web-based applications. Within the designers, you build workflow much like you'd create a flowchart with a tool such as Microsoft Visio. WF also allows you to package the designers for reuse.


For example, you could build a Windows application that allows business people to create their own workflow libraries. The design tools that become part of VS2005 make up the first component of the overall WF. The next component is the actual workflow. Workflow is made up of a group of activities. These activities facilitate a business process or part of a business process. Activities are a central idea within the concept of workflow and the WF. A single workflow within WF is made up of one or more activities. In the context of the WF, activities are the actual work units necessary to perform a workflow. A number of out-of-the-box activities are provided as part of the WF. These out-of-the-box activities are part of the WF base activity library. You aren't restricted only to these activities; you can create custom activities and create your own library. You create the custom activities using the VS2005 Workflow Designers.


The next component of the WF is the WF runtime engine. The WF runtime engine executes workflow, made up of activities, and created with the VS2005 Workflow Designers. The runtime engine also includes services such as scheduling, state management, and rules. The scheduling service schedules the execution of activities within a given workflow. The state management service allows the state of a workflow to be persisted, instead of storing that state in another mechanism, such as a database. The rules service executes Policy activities.



Policy activities in the section entitled "Out-of-the-Box Activities". For now, realize that you can create workflows that are based on business rules and that perform some action when those rules are satisfied. The rules service handles all this.



The last component of WF is a host process. WF itself doesn't have an executable environment. Instead, another process must host the runtime engine and workflows. This host process may be a Windows application or an ASP.NET application. During development, this host process is VS2005. The soon-to-be-released Microsoft Office 12 can also be a host for a workflow created with WF.



  • Windows Communication Foundation(WCF) :


One of the biggest IT topics today has to be the concept of Service-Oriented Architecture (SOA).Service-Oriented Architecture isn't new. You'd think that with the coverage it has received over the past few years that developers and "techy" individuals would understand it better, yet it ranks fairly high on the misunderstood-o-meter because its interpretation, implementation, and use is pretty loose due to the fairly vague definition. When you want to understand the meaning of something, you usually go to a place that defines it, such as a dictionary. In this case, we turn to the W3C to understand the definition of SOA. The

W3C defines Service-Oriented Architecture as "A set of components which can be invoked and

Whose interface descriptions can be discovered and published" As you sit and ponder this definition, it becomes quite apparent that this definition is fairly broad. It also becomes apparent why the Service-Oriented Architecture picture is somewhat fuzzy, because the definition leaves a lot of room for interpretation.


With this in mind, the purpose of this chapter is twofold. First, to better explain what SOA is and the need for it; and second, to introduce Windows Communication Foundation (WCF) and the following content:


❑ The need for SOA

❑ How Windows Communication Foundation addresses the SOA needs



Service-Oriented Architecture Principles:


Streams of information have been flowing from Microsoft in the forms of articles and white papers

Regarding its commitment to SOA and in this entire information one of the big areas constantly stressed are the principles behind service orientation:



❑ Explicit boundaries

❑ Autonomous services

❑ Policy-based compatibility

❑ Shared schemas and contracts



Explicit Boundaries


As you will learn in the next section, SOA is all about messaging—sending messages from point A to point B. These messages must be able to cross explicit and formal boundaries regardless of what is behind those boundaries. This allows developers to keep the flexibility of how services are implemented and deployed. Explicit boundaries mean that a service can be deployed anywhere and be easily and freely accessed by other services, regardless of the environment or development language of the other service.


The thing to keep in mind is that there is a cost associated with crossing boundaries. These costs come in a number of forms, such as communication, performance, and processing overhead costs. Services should be called quickly and efficiently.


Autonomous Services:


Services are built and deployed independently of other services. Systems, especially distributed systems, must evolve over time and should be built to handle change easily. This SOA principle states that each service must be managed and versioned differently so as to not affect other services in the process. In the book publisher example, the Order Process service and Order Fulfillment service are completely independent of each other; each is versioned and managed completely independent of the other. In this way, when one changes it should not affect the other. It has been said that services should be built not to fail. In following this concept, if a service is unavailable for whatever reason or should a service depend on another service that is not available, every precaution should be taken to allow for such services to survive, such as redundancy or failover.


Policy-Based Compatibility:


When services call each other, it isn't like two friends meeting in the street, exchanging pleasantries, and then talking. Services need to know a little more about each other. Each service may or may not have certain requirements before it will start communicating and handing out information. Each service has its own compatibility level and knows how it will interact with other services. These two friends in fact aren't friends at all. They are complete and total strangers. When these two strangers meet in the street, an interrogation takes place, with each person providing the other with a policy. This policy is an information sheet containing explicit information about the person. Each stranger scours the policy of the other looking for similar interests. If the two services were to talk again, it would be as if they had never met before in their life. The whole interrogation process would start over.

This is how services interact. Services look at each others' policy, looking for similarities so that they can start communicating. If two services can't satisfy each others' policy requirements, all bets are off. These policies exist in the form of machine-readable expressions. Policies also allow you to move a service from one environment to another without changing the behavior of the service.


Shared Schemas and Contracts:


Think "schemas = data" and "contracts = behavior." The contract contains information regarding the structure of the message. Services do not pass classes and types; they pass schemas and contracts. This allows for a loosely coupled system where the service does not care what type of environment the other service is executing on. The information being passed is 100 percent platform independent. As described previously, a service describes it capabilities.


Why Windows Communication Foundation:


Windows Communication Foundation (WCF) is a platform, a framework if you will, for creating and distributing connected applications. It is a fusion of current distributed system technologies designed and developed from day one with the goal of achieving SOA nirvana, or coming as close to it as possible. WCF is a programming model that enables developers to build service solutions that are reliable and secure, and even transacted. It simplifies development of connected applications and offers something to developers that they have not seen in quite a while—a unified, simplified, and manageable distributed system development approach.


Built on top of the 2.0 .NET Framework CLR (Common Language Runtime), the Windows

Communication Foundation is a set of classes that allow developers to build service-oriented applications in their favorite .NET environment (VB.NET or C#). This section begins by taking a detailed look at the architecture of WCF and the components that make WCF what it is.



  • Windows Presentation Foundation (WPF):


Introduction:


When .NET first appeared, it introduced a small avalanche of new technologies. There was a whole new way to write web applications (ASP.NET), a whole new way to connect to databases (ADO.NET), new typesafe languages (C# and VB .NET), and a managed runtime (the

CLR). Not least among these new technologies is Windows Forms, a library of classes for building Windows applications. Although Windows Forms is a mature and full-featured toolkit, it's hardwired to essential bits of Windows plumbing that haven't changed much in the past ten years. Most significantly, Windows Forms relies on the Windows API to create the visual appearance of standard user interface elements such as buttons, text boxes, check boxes, and so on. As a result, these ingredients are essentially uncustomizable. For example, if you want to create a stylish glow button you need to create a custom control and paint every aspect of the button (in all its different states) using a lower-level drawing model. And don't even think about introducing animated effects such as spinning text, shimmering buttons, shrinking windows, or live previews because you'll have to paint every detail by hand!


The Windows Presentation Foundation (WPF) changes all this by introducing a new model with entirely different plumbing. Although WPF includes the standard controls you're familiar with, it draws every text, border, and background fill itself. As a result, WPF can provide much more powerful features that let you alter the way any piece of screen content is rendered. Using these features, you can restyle common controls such as buttons, often without writing any code. Similarly, you can use transformation objects to rotate, stretch, scale, and skew anything in your user interface, and you can even use WPF's baked-in animation system to do it right before the user's eyes.


Underlying the new features in WPF is a powerful new infrastructure based on DirectX,

The hardware-accelerated graphics API that's commonly used in cutting-edge computer

Games. This means that you can use rich graphical effects without incurring the performance

Overhead that you'd suffer with Windows Forms. In fact, you even get advanced features such

As support for video files and 3-D content. Using these features (and a good design tool), it's

Possible to create eye-popping user interfaces and visual effects that would have been all but

Impossible with Windows Forms.



Understanding Windows Graphics:


It's hard to appreciate how dramatic WPF is without realizing that Windows developers have been using essentially the same display technology for more than ten years. A modern Windows application built with C# indirectly relies on two parts of the Windows operating system to create its user interface:


User32 provides the familiar Windows look and feel for elements such as windows, buttons, text boxes, and so on.

GDI/GDI+ provides drawing support for rendering shapes, text, and images at the cost of additional complexity (and often lackluster performance).


DirectX: The New Graphics Engine:


Microsoft created one way around the limitations of the User32 and GDI/GDI+ libraries:

DirectX. DirectX began as a cobbled-together, error-prone toolkit for creating games on the

Windows platform. Its design mandate was speed, and so Microsoft worked closely with video card vendors to give DirectX the hardware acceleration needed for complex textures, special effects such as partial transparency, and three-dimensional graphics.



Over the years since it was first introduced (shortly after Windows 95), DirectX has matured. It's now an integral part of Windows, with support for all modern video cards. However, the programming API for DirectX still reflects its roots as a game developer's toolkit. Because of its raw complexity, DirectX is almost never used in traditional types of Windows applications (such as business software).


WPF changes all this. In WPF, the underlying graphics technology isn't GDI/GDI+. Instead, it's DirectX. Remarkably, WPF applications use DirectX no matter what type of user interface you create. That means that whether you're designing complex three-dimensional graphics (DirectX's forté) or just drawing buttons and plain text, all the drawing work travels through the DirectX pipeline. As a result, even the most mundane business applications can use rich effects such as transparency and antialiasing. You also benefit from hardware acceleration, which simply means DirectX hands off as much work as possible to the GPU (graphics processing unit), which is the dedicated processor on the video card.



Hardware Acceleration and WPF:


You're probably aware that video cards differ in their support for specialized rendering features and optimizations. When programming with DirectX, that's a significant headache. With WPF, it's a much smaller concern, because WPF has the ability to perform everything it does using software calculations rather than relying on built-in support from the video card.



Silverlight:


Like the .NET Framework itself, WPF is a Windows-centric technology. That means that

WPF applications can only be used on computers running the Windows operating system (specifically, Windows XP or Windows Vista). Browser-based WPF applications are similarly limited—they can only run on Windows computers, and they can only be hosted inside Internet

Explorer. There are some workarounds to support other browsers, but they're limited.

These restrictions won't change—after all, part of Microsoft's goal with WPF is to take advantage of the rich capabilities of Windows computers and its investment in technologies such as DirectX. However, there is a new emerging project named Silverlight that's designed to take a subset of the WPF platform, host it in any modern browser using a plug-in (including

Firefox and Safari), and open it up to other operating systems (such as Linux and Mac OS).

This is an ambitious project, and it's still not clear how much developer interest it will attract and how good its cross-platform support will be. Microsoft has already released early previews of the Silverlight technology, which was originally named WPF/E (WPF Everywhere) because it provides a subset of the features in WPF.





XAML:


XAML (short for Extensible Application Markup Language and pronounced "zammel" is a markup language used to instantiate .NET objects. Although XAML is a technology that can be applied to many different problem domains, its primary role in life is to construct WPF user interfaces. In other words, XAML documents define the arrangement of panels, buttons, and controls that make up the windows in a WPF application.




  • CARDSPACE :


The Internet continues to be increasingly valuable, and yet also faces significant challenges. Online identity theft, fraud, and privacy concerns are rising. Users must track a growing number of accounts and passwords. This burden results in "password fatigue," and that results in insecure practices, such as reusing the same account names and passwords at many sites. Many of these problems are rooted in the lack of a widely adopted identity solution for the Internet.


CardSpace is Microsoft's implementation of an Identity Metasystem that enables users to choose from a portfolio of identities that belong to them and use them in contexts where they are accepted, independent of the underlying identity systems where the identities originate and are used.


For users and businesses alike, the Internet continues to be increasingly valuable. More people are using the Web for everyday tasks, from shopping, banking, and paying bills to consuming media and entertainment. E-commerce is growing, with businesses delivering more services and content across the Internet, communicating and collaborating online, and inventing new ways to connect with each other.

But as the value of what people do online have increased, the Internet itself has become more complex and dangerous. Online identity theft, fraud, and privacy concerns are on the rise. And increasingly sophisticated practices such as "phishing" are invented. In response, a multitude of systems designed to protect identity have been devised. The diversity results in the aforementioned password fatigue and unsafe practices.

The root of these problems is that the Internet was designed without a system of digital identity in mind. In efforts to address this deficiency, numerous digital identity systems have been introduced, each with its own strengths and weaknesses. But no single system meets the requirements of every digital identity scenario. The reality is that many different identity systems are in use today, with still more being invented. The result is an inconsistent patchwork of improvised solutions at every Web site, rendering the system as a whole fragile, and constraining the fuller realization of the promise of e-commerce.


Source : offshoresoftwaredevelopmentindia

No comments: