Beruflich Dokumente
Kultur Dokumente
NET
1 ER/CORP/CRS/LA31/003
1
Course Objectives
services
The objective of this course is to help the DotNet user in understanding the need for the .NET
framework and to understand
1. the various building blocks of the .NET development platform which offer great support for
the Web Services paradigm
2. the constituents of the .NET framework architecture, mainly the Common Language
Runtime (CLR) and the Common Language Specification (CLS)
3. the process of source code compilation & execution, the creation & structure of the smallest
unit of deployment called Assembly and the role played by Metadata, which is compulsorily
built into the Assembly.
Also we’ll take a quick overview of the fundamental components of the .NET 3.0 platform –
1. The Windows Communication Foundation (WCF): a service-oriented messaging system
which allows programs to interoperate locally or remotely similar to web services.
2. The Windows Presentation Foundation (WPF): a new user interface subsystem and API
based on XML and vector graphics, which will make use of 3D computer graphics hardware
and Direct3D technologies
3. The Workflow Foundation (WF): allows for building of task automation and integrated
transactions using workflows.
4. The Windows CardSpace (previously called as InfoCard): a software component which
securely stores a person's digital identities and provides a unified interface for choosing the
identity for a particular transaction, such as logging in to a website.
5. Last but not the least, we’ll look at .NET’s implementation of the Unified programming
model in order to understand the order to understand the integration of different languages
based on the .NET platform.
*END*
2
Course Objectives Continued…
Windows CardSpace
The objective of this course is to help the DotNet user in understanding the need for the .NET
framework and to understand
1. the various building blocks of the .NET development platform which offer great support for
the Web Services paradigm
2. the constituents of the .NET framework architecture, mainly the Common Language
Runtime (CLR) and the Common Language Specification (CLS)
3. the process of source code compilation & execution, the creation & structure of the smallest
unit of deployment called Assembly and the role played by Metadata, which is compulsorily
built into the Assembly.
Also we’ll take a quick overview of the fundamental components of the .NET 3.0 platform –
1. The Windows Communication Foundation (WCF): a service-oriented messaging system
which allows programs to interoperate locally or remotely similar to web services.
2. The Windows Presentation Foundation (WPF): a new user interface subsystem and API
based on XML and vector graphics, which will make use of 3D computer graphics hardware
and Direct3D technologies
3. The Workflow Foundation (WF): allows for building of task automation and integrated
transactions using workflows.
4. The Windows CardSpace (previously called as InfoCard): a software component which
securely stores a person's digital identities and provides a unified interface for choosing the
identity for a particular transaction, such as logging in to a website.
5. Last but not the least, we’ll look at .NET’s implementation of the Unified programming
model in order to understand the order to understand the integration of different languages
based on the .NET platform.
*END*
3
Browsing Era
Positives:
Global connectivity
Simplicity
Mainstream
Negatives:
“Read-only”
No user control
Too many islands
Keyboard only
4 ER/CORP/CRS/LA31/003 We enable you to leverage knowledge
anytime, anywhere!
The evolution of technology– right from the terminal mainframe era through
the Character PC era and the rich GUI-based applications to the current
Internet Browsing era - has brought in major enhancements along with some
negatives as listed on the slide.
•The era of browsing the Internet wasn’t all bad. It was simple, easy to
understand, and offered a sense of global connectivity. But it required a
keyboard, created too many islands of information, and gave the user very
little control.
*END*
4
Technology Drivers
• Computing power
– Still doubling every 18 months
– PC-based data centers
• Connectivity
– Low cost, broad reach Internet and Wireless, broadband access
• Device proliferation
– Multiple devices - PDAs, Mobile phones, laptops
• Internet Standards
– XML-Based integration
• Single Tier ->Client/Server -> Windows DNA -> .NET
•The constant evolution of technology and standards, is enabled with every day increase in
computing power and connectivity, through various devices on the one hand, and low and
affordable prices on the other.
•Most important is the evolution of eXtensible Markup Language (XML) as the internet standard for
information exchange, that has made tremendous impact on application integration.
•When automation first hit business, it was in the form of a huge "Mainframe" computer in the
Single-Tier model. Here, a central computer served the whole business community and was
accessed via dumb terminals.
•In the 1980s, a revolution happened in the world of business computing when the Personal
Computer hit the streets. In order to provide personal software which ran on personal computers,
a model needed to be found where the enterprise could still share data. This became known as
the client/server model. The client (on the personal computer) would connect to a central computer
(server) and request data.
•We've shoe-horned applications into architectures instead of architecting solutions in order to
provide perfect fit. Why? Because solutions involving any degree of distribution were difficult to
implement cost-effectively - that is until the tools necessary to provide the choice of using Web
Services, Enterprise Serviced Components, and HTTP or TCP/IP Remoting was made available
by Microsoft’s Windows DNA (D istributed InterN et A rchitecture) that is an umbrella term for
Microsoft's enterprise network architecture built into Windows 2000. It includes all the components
that collectively provide a Web-enabled infrastructure for an organization, like Web Server, ASP
technology, COM Objects, MTS and MSMQ and AppCenter Server. The DNA moniker was coined
in 1997 for Windows NT. The term is not often used except when Microsoft products are
contrasted to the later .NET framework, in which case DNA means "prior to .NET."
*CONT.*
5
• This slide is intentionally left blank for notes continued
from previous page
•Windows DNA applications can be extended to become Web services, which can
then be integrated and orchestrated with other Web services using the .NET
platform. This idea of exposing certain functionality of an application, to the outside
world in the form of a Web Service, is much more enabled using the .NET platform
and the development, deployment and management of these new applications and
services will be greatly simplified by new .NET tools and technologies delivered by
Microsoft.
*END*
6
Need for .NET framework
So what were the major issues that caused Microsoft to come out with the new .NET framework after
Windows DNA?
• Problems crop up during the integration of a single application’s subsystems that have been
developed with multiple technologies. For example, a manufacturing organization would have different
systems, such as an inventory management system, a bill of material systems, and a general ledger
system, all implemented using various technologies available for application development. These
systems need to be integrated to form a higher-level enterprise information system for an organization.
To do so, application developers had to use technologies such as Microsoft Distributed Component
Object Model (DCOM), Common Object Request Broker Architecture (CORBA), Java Remote Method
Invocation (RMI), and so on. However, these distributed technologies are very tightly coupled to the
programming languages in which these applications have been developed
• Cross-language interoperability is also limited. For example, if classes had been developed in Visual
C++, it was not possible to develop new classes in Visual Basic that extended from those developed in
Visual C++. Therefore, developers would have to rewrite the same logic for the classes in all the
languages that were supported in their organization. Functional reusability was supported, but true
code reusability was not available in earlier technologies; therefore, a developer was forced to learn all
languages that were being used for application development in the organization.
• Registration of COM components. COM components had to be registered on the target machine
before they could be used by the application. The application had to look up the Windows registry to
locate and load the COM components.
• Unloading COM components. COM objects also required a special logic for freeing up the objects from
memory. This method is known as reference counting of COM objects. It is used to keep track of the
number of active references. When an object's reference count reaches zero, the object is removed
from memory. The major problem that arises out of this situation is that of circular reference. If circular
references exist between two COM components, they would not be freed from memory.
*CONT.*
7
This slide is intentionally left blank for the notes continued
from the previous slide
•Dynamic link library (DLL) hell. Whenever applications that use COM components
were installed on a machine, the installation process would update the registry with
the COM components information. Thus, there was a chance that these DLLs would
be overwritten when some other applications were installed on the same computer.
Therefore, an application that had been referring to one particular DLL would refer
to the wrong DLL. This caused a major problem when an application was referring
to particular version of a DLL.
*END*
8
.NET Design Goals
The .NET framework was designed with the following goals in mind –
1. To simplify the process of application development, deployment, execution and
maintenance.
2. To provide a common programming model such that components written in one
language can be used & extended by components written in other .NET-
compatible languages.
3. To provide a high level of code access security that enables administrators and
developers to authorize applications similar to the way they have always been
able to authorize users.
4. To use web standards & best practices of XML and standard protocols like
SOAP, HTTP, etc to ensure the maximum acceptability of the applications
developed.
*END*
9
.NET Design Goals Continued…
The .NET framework was designed with the following goals in mind –
1. To simplify the process of application development, deployment, execution and
maintenance.
2. To provide a common programming model such that components written in one
language can be used & extended by components written in other .NET-
compatible languages.
3. To provide a high level of code access security that enables administrators and
developers to authorize applications similar to the way they have always been
able to authorize users.
4. To use web standards & best practices of XML and standard protocols like
SOAP, HTTP, etc to ensure the maximum acceptability of the applications
developed.
*END*
10
.NET Platform
11
The .NET Platform
Building blocks
•This slide gives a bird’s-eye view of the building blocks of the .NET platform.
•As seen in the figure, Microsoft .NET Framework is a computing platform that is a layer above the
Operating System and is used for developing distributed applications for the Internet and supports
many types of web services –
•External Web Services enable different organizations to exchange services over the
Internet
•Internal Web Services are owned by the organization that uses them .
•The .NET foundation services are a set of XML Web services like Passport (for user
identification) and services for user-preference management, calendar management, etc
that are used to move control of user data between various applications and users.
•The server infrastructure for .NET Framework, including Windows and the .NET Enterprise
Servers, is a suite of infrastructure applications for building, deploying and operating XML Web
services. Some of these servers are –
•BizTalk Server to create and manage XML-based business process orchestration across
applications and services
•SQL Server to store and retrieve structured XML data
•SharePoint™ Portal Server that acts as a default intranet portal and collaboration tool
•Exchange Server for email messaging and collaboration software
•Visual Studio .NET is a new rapid application development (RAD) tool that is common to all the
Microsoft programming languages in the .NET Framework.
•A .NET component is a pre-compiled class module with a .DLL extension. At run-time, it is
invoked and loaded into memory to be used by some consumer application.
Thus, the .NET platform allows the creation of both web and windows applications along with the
ability to expose required functionality of an application in the form of web services, to the outside
world.
*END*
12
.NET Platform – In Depth
Web Services
•Enables software
as a service
•Based on XML
•SOAP is a W3C
standard.
•IBM, Ariba,
Commerce One,
Web Services
Iona, Rogue Wave
XML, SOAP, HTTP, HTML
•The common Internet standards of XML, SOAP, HTTP and HTML form the basic building
block to provide web services.
•In fact, SOAP (Simple Object Access Protocol) is an open standard with strong third party
support from major Industry vendors.
•Web Services makes use of these open standards rather than any proprietary standards for
information exchange
*END*
13
.NET Platform – In Depth
.NET Framework
•Foundation for
building, deploying,
and running Web
Services
•Productive,
extensible, multi-
.NET Framework language
•Integration through
Web Services public Internet
XML, SOAP, HTTP, HTML standards
14 ER/CORP/CRS/LA31/003 We enable you to leverage knowledge
anytime, anywhere!
14
.NET Platform – In Depth
Visual Studio.NET
•Most productive
tool for developing
Visual Studio.NET
Web Services,
applications
•Unified
.NET Framework programming
model, IDE
Web Services •Builds on today’s
XML, SOAP, HTTP, HTML capabilities
15 ER/CORP/CRS/LA31/003 We enable you to leverage knowledge
anytime, anywhere!
15
.NET Platform – In Depth
The final picture .NET languages
Microsoft .NET ADA
Development Platform
APL
Customers, Partners COBOL
Delivering Web Services
Pascal
3rd Party
Visual Studio.NET
Languages and Tools Eiffel
3rd Party Visual Perl
.NET Framework
Infrastructure
Visual Python
Web Services Smalltalk
XML, SOAP, HTTP, HTML
and many more
•As seen here, the .NET development platform can have 3rd party
infrastructure or languages or IDE tools with the end goal of delivering web
services or applications.
•This is a win-win situation where in the end users consuming the web
services or applications would be benefited the most.
*END*
16
Enterprise Servers
• Application Center Server
– Load balancing, clustering, replication and central management of multiple
IIS Web servers.
• Commerce Server
– A merchant server with shopping cart and credit card capabilities.
• Internet Security and Acceleration (ISA) Server
– A firewall, Web caching and policy management server. Replaces Microsoft
Proxy Server.
• Exchange Server
– An e-mail messaging and collaboration server.
This slide lists the family of server products from Microsoft that support the .NET
Framework and provide back office services, called Enterprise Servers.
*END*
17
Enterprise Servers Continued…
• Mobile Information Server
– An extension to Exchange Server for mobile users.
• BizTalk Server
– An integration server based on XML.
• SQL Server
– Microsoft's database management system (DBMS).
This slide lists the family of server products from Microsoft that support the .NET
Framework and provide back office services, called Enterprise Servers.
*END*
18
The Web Services Revolution
The Paradigm for the Digital Economy
• Integration Is Intrinsic
– An industry initiative
– Based on cross-platform standards
– Data and services
• Software As A Service
– Operate locally or hosted
– Programmability
– Any place, any time, any device
So what is this Web Services initiative that is driven across by the Industry rather
than by a single company?
•Web Services is not any proprietary standard but is basically meant to address the
cross platform integration of applications serving data and services
•Web Services can be hosted on the internet or within an organization depending on
ones need.
•Using Web Service one can extend the application just like a function call. For
simplicity lets assume a fictitious service provider company, BCal provides basic
calculator feature such as addition, subtraction, multiplication and division as web
service. You can extend this application by calling the services of BCal for basic
features and give your own implementation for scientific calculator features such as
Sin, Tan, Cosine, Secant, Cotangent and inverse by writing code for these and
expose this as web service or as a simply web or windows application.
•These services can be accessed using any type of device, as the code we would
write will be only for the functionality. The .net framework has built-in intelligence to
identify the client and emit code acceptable by the client. For example, if the request
is made from a desktop, the output would be HTML pages and if accessed by cell
phone the output would be .wml file. There wouldn’t be a need to write any extra or
separate code for these two devices.
*END*
19
Web Services – An Example
www.microsoft.com
Let us look at a scenario where Web Services are used – that of Supply
chain management
Supplier A supplies items A1, A2, A3
Supplier B supplies items B1, B2, B3
Supplier C supplies items C1, C2, C3
You are hosting a site that supplies all the above. You have tied up with
suppliers A, B and C for selling their products. A customer visits your site
and gets all items supplied by A, B and C giving an overall good and
delightful experience for the customer. If the same customer visits Supplier
A, s/he would get only products sold by customer A as long as supplier A
doesn’t have any tie up with supplier B and C.
This example illustrates a B2C case study while web services can be used in
a B2B Scenario also.
*END*
20
.NET Framework
21
The .NET Framework 3.0 Architecture
•The entire .NET framework 2.0 with native support for XML and web service
incorporates a lot of new additional features while there exists over it a layer of new
components like WPF, “InfoCard”, WCF and WF.
•The Microsoft Windows Presentation Foundation (formerly code named "Avalon")
provides the foundation for building applications and high fidelity experiences in
Longhorn, blending together application UI, documents, and media content, while
exploiting the full power of your computer.
•Windows CardSpace (formerly "InfoCard") is a Microsoft NET Framework 3.0
(formerly WinFX) component that provides the consistent user experience required
by the identity metasystem. It is specifically hardened against tampering and
spoofing to protect the end user's digital identities and maintain end-user control.
•Windows Communication Foundation (formerly code-named "Indigo") is a set of
.NET technologies for building and running connected systems. It is a new breed of
communications infrastructure built around the Web services architecture.
•Windows Workflow Foundation is the programming model, engine and tools for
quickly building workflow enabled applications on Windows. It consists of a
Microsoft NET Framework version 3.0 (formerly WinFX) namespace, an in-process
workflow engine, and designers for Visual Studio 2005.
*END*
22
The .NET Framework 3.0 Architecture
http://msdn2.microsoft.com/hi-in/netframework/aa663309.aspx
•The entire .NET framework 2.0 with native support for XML and web service
incorporates a lot of new additional features while there exists over it a layer of new
components like WPF, “InfoCard”, WCF and WF.
•The Microsoft Windows Presentation Foundation (formerly code named "Avalon")
provides the foundation for building applications and high fidelity experiences in
Longhorn, blending together application UI, documents, and media content, while
exploiting the full power of your computer.
•Windows CardSpace (formerly "InfoCard") is a Microsoft NET Framework 3.0
(formerly WinFX) component that provides the consistent user experience required
by the identity metasystem. It is specifically hardened against tampering and
spoofing to protect the end user's digital identities and maintain end-user control.
•Windows Communication Foundation (formerly code-named "Indigo") is a set of
.NET technologies for building and running connected systems. It is a new breed of
communications infrastructure built around the Web services architecture.
•Windows Workflow Foundation is the programming model, engine and tools for
quickly building workflow enabled applications on Windows. It consists of a
Microsoft NET Framework version 3.0 (formerly WinFX) namespace, an in-process
workflow engine, and designers for Visual Studio 2005.
*END*
23
.NET Framework 2.0 Architecture
http://www.ies.aust.com/ten/ten19_files/image001.gif
24
.NET Framework 2.0 Architecture
Common Language Runtime
http://www.ies.aust.com/ten/ten19_files/image001.gif
25
Common Language Runtime (CLR)
• Simplified Development
• Multi-Language Development
• Simplified Deployment
• Seamless Integration with COM objects
• Manages running code
– Verifies type safety
– Provides garbage collection, error handling
– Code access security for semi-trusted code
CLR is the main runtime engine for dot net. This is responsible for verifying type safety,
garbage collection and error handling along with Code Access Security.
•As mentioned earlier the development should be specific to implementing the
functionality needed rather than writing marshalling code or plumbing code etc.
•One project can have multiple modules implemented using different dot net languages
and the integration is seamless
•Assemblies provide a way for simplified deployment. No more registering of components
thereby removing the dependency on registry. The inherent disadvantage of not allowing
for simultaneous multiple versions of components is overcome in dot net. This problem is
referred to as dll hell. Making use of existing COM components without any issues will be
as simple as adding a reference and making use of this in the project.
•Code access security (CAS) is a new feature provided by the .NET Common Language
Runtime. CAS is the part of the .NET security model that determines whether or not a
piece of code is allowed to run, and what resources it can access when it is running.
Before .NET all applications were having complete access to all local resources on the
system based on the privileges granted to the id which had logged in. There was no way
of restricting the code from not accessing part of the privileges granted to the context in
which the code was being executed. Hence there is a serious threat whenever a code is
being downloaded and executed on the system.
*CONT.*
26
Common Language Runtime (CLR) Contd…
CLR is the main runtime engine for dot net. This is responsible for verifying type safety,
garbage collection and error handling along with Code Access Security.
•As mentioned earlier the development should be specific to implementing the
functionality needed rather than writing marshalling code or plumbing code etc.
•One project can have multiple modules implemented using different dot net languages
and the integration is seamless
•Assemblies provide a way for simplified deployment. No more registering of components
thereby removing the dependency on registry. The inherent disadvantage of not allowing
for simultaneous multiple versions of components is overcome in dot net. This problem is
referred to as dll hell. Making use of existing COM components without any issues will be
as simple as adding a reference and making use of this in the project.
•Code access security (CAS) is a new feature provided by the .NET Common Language
Runtime. CAS is the part of the .NET security model that determines whether or not a
piece of code is allowed to run, and what resources it can access when it is running.
Before .NET all applications were having complete access to all local resources on the
system based on the privileges granted to the id which had logged in. There was no way
of restricting the code from not accessing part of the privileges granted to the context in
which the code was being executed. Hence there is a serious threat whenever a code is
being downloaded and executed on the system.
*CONT.*
27
This slide is intentionally left blank for the notes
continued from the previous slide
•CLR implements Code Access Security based on the evidence for an Assembly.
Assemblies will be discussed in future slide. Evidence can be such as from which
site the code is being downloaded, any strong name key available or digital
signatures and assigns the code to a particular code group based on the evidence.
Each code group has a set of permissions which define what all the assembly can
access and perform.
•By default memory management is done by CLR and the garbage collection runs
as a low priority thread. The execution of this is non deterministic. This implies that
no more pointer access by default. Relinquishing of memory is done by the
garbage collection once the object are marked for garbage collection. However
Microsoft hasn’t removed the feature of pointers completely. One can use pointers
by writing unmanaged code using keyword unsafe.
•NET Framework applications will eventually replace those developed with COM.
Until then, you may need to use or create COM objects with Visual Studio.
Interoperability with COM, or COM interop, enables you to use existing COM
objects while transitioning to the .NET Framework at your own pace.
*END*
28
Common Language Runtime
Compilation & Execution
This slide illustrates the role of the CLR in execution of the assembly obtained after
the compilation of the source file (written in a .NET language).
All language compilers generate the same MSIL (Microsoft Intermediate Language)
code in the Assembly stored inside a .PE (Portable Executable) file. This contains
both code and metadata. The MSIL can be deployed to compile to native code
either before installation or the first time each method is called (Just In Time
compiler).
All code that is executed by the CLR ( or targetted to run by the CLR) is called
managed code. Any code that is executed directly on the Operating System is
called unmanaged code.
*END*
29
So what is an assembly?
•This is the basic deployment unit of any dotnet executable with an extension .dll or
.exe, which runs within CLR
•Assemblies are the building blocks used by the .NET Framework to solve the
versioning and deployment issues just described. Assemblies are the deployment
unit for types and resources. In many ways an assembly equates to a DLL in today's
world; in essence, assemblies are "logical DLLs.“
•Assemblies are self-describing through metadata called a manifest. Just as .NET
uses metadata to describe types, it also uses metadata to describe the assemblies
that contain the types.
•Assemblies are about much more than deployment. For example, versioning in
.NET is done at the assembly level—nothing smaller, like a module or a type, is
versioned. Also, assemblies are used to share code between applications. The
assembly that a type is contained in is part of the identity of the type.
•The code access security system uses assemblies at the core of its permissions
model. The author of an assembly records in the manifest the set of permissions
required to run the code, and the administrator grants permissions to code based on
the assembly in which the code is contained.
•Finally, assemblies are also core to the type system and the run-time system in that
they establish a visibility boundary for types and serve as a run-time scope for
resolving references to types.
[For more on assemblies, refer http://msdn2.microsoft.com/en-
gb/library/ms973843.aspx]
*END*
30
Metadata
•A .NET language compiler will generate the metadata and store this in the
assembly containing the Common Intermediate Language (CIL). Metadata
describes all classes and class members that are defined in the assembly,
and the classes and class members that the current assembly will call from
another assembly. The metadata for a method contains the complete
description of the method, including the class (and the assembly that contains
the class), the return type and all of the method parameters. So when the
CLR executes CIL code, it will check to make sure that the metadata of the
called method is the same as the metadata that is stored in the calling
method. This ensures that a method can only be called with exactly the right
number of parameters and exactly the right parameter types.
•This is similar to the type library information of COM which is generated
during compilation. However, unlike type library information of COM, here
metadata is mandatory for execution.
*END*
31
What’s In The Metadata
Metadata in an assembly may be viewed using the ILDASM tool provided by the
.NET Framework SDK.
*END*
32
.NET Framework Namespace
http://www.inf.pucminas.br/sblp2003/sblp2003_files/dotnet.pdf
33 ER/CORP/CRS/LA31/003 We enable you to leverage knowledge
anytime, anywhere!
The .NET Framework namespace is as shown above. All these & more
namespaces are to be found in the Base Class Library.
*END*
33
Features in .NET
• ADO.NET
• ASP.NET
• Authenticated Streams
•The new generation of 64-bit computers enables the creation of applications that can
run faster and take advantage of more memory than is available to 32-bit applications.
New support for 64-bit applications enables users to build managed code libraries or
easily use unmanaged code libraries on 64-bit computers.
•An access control list (ACL) is used to grant or revoke permission to access a
resource on a computer. New classes have been added to the .NET Framework that
allow managed code to create and modify an ACL. New members that use an ACL
have been added to the I/O, registry, and threading classes.
•New features in ADO.NET include support for user-defined types (UDT),
asynchronous database operations, XML data types, large value types, snapshot
isolation, and new attributes that allow applications to support multiple active result
sets (MARS) with SQL Server 2005.
•The Microsoft .NET Framework 2.0 includes significant enhancements to all areas of
ASP.NET –
•New controls to add commonly-used functionality to dynamic web
pages
•New data controls
•Improved code-behind model
•Caching features
•Customization of web sites and pages
•Support for a wide variety of browsers
•New authenticated stream classes like NegotiateStream and SslStream support
mutual authentication, data encryption, and data signing.
*CONT.*
34
This slide is intentionally left blank for the notes continued
from the previous slide
•Four major enhancements have been made to the classes and tools that support
interoperability with COM:
•The new SafeHandle and CriticalHandle classes, and their
specialized derived classes, provide safe and reliable means of
manipulating operating system handles.
•Two enhancements to the interop marshaler satisfy the two most
common user requests: the ability to wrap native function pointers into
delegates and the ability to marshal fixed-size arrays of structures
inside structures.
•The performance of calls between applications in different application
domains has been made much faster for common call types.
•New switches on the Type Library Importer (Tlbimp.exe) and Type
Library Exporter (Tlbexp.exe) eliminate dependency on the registry to
resolve type library references. This enhancement is important for
creating robust build environments.
*END*
35
Features in .NET … continued
• Console Class Additions
• Data Protection API
• Debugger features
• Network & I/O Enhancements
• Distributed computing
• Generics and Generic Collections
• .NET Framework Remoting
• Manifest-Based Activation
• Windows Forms–Related Features
• XML-Related Features
•New members of the Console class enable applications to manipulate the dimensions of the
console window and screen buffer; to move a rectangular area of the screen buffer, which is
useful for performing smooth, simple animation; and to wait while reading console input until a
key is pressed.
•The new Data Protection API (DPAPI) includes four methods that allow applications to
encrypt passwords, keys, connections strings, and so on, without calling platform invoke.
•The debugger's Display Attributes feature enables you to identify the most useful information
to display in the debugger. The .NET Framework 2.0 reintroduces the Edit and Continue
feature that enables a user who is debugging an application in Visual Studio to make changes
to source code while executing in Break mode.
•The NetworkChange class provides address change notification by raising events when a
change is detected. Using classes in the System.Net.NetworkInformation namespace,
applications can access IP, IPv4, IPv6, TCP, and UDP network traffic statistics. The Ping
class allows an application to determine whether a remote computer is accessible over the
network. You can use the HttpListener class to create a simple Web server that responds to
HTTP requests. Improvements have been made to the usability and functionality of various
I/O classes. It is now easier for users to read and write text files and obtain information about
a drive.
•Language features collectively known as generics act as templates that allow classes,
structures, interfaces, methods, and delegates to be declared and defined with unspecified, or
generic type parameters instead of specific types. The new System.Collections.Generic
namespace provides support for strongly typed collections. System.Nullable<T> is a standard
representation of optional values. Generics are supported in three languages: Visual Basic,
C#, and C++. Reflection has been extended to allow runtime examination and manipulation of
generic types and methods.
*CONT.*
36
This slide is intentionally left blank for the notes continued
from the previous slide
•.NET Framework remoting now supports IPv6 addresses and the exchange of generic types.
The classes in the System.Runtime.Remoting.Channels.Tcp namespace support authentication
and encryption using the Security Support Provider Interface (SSPI).
•Manifest-based activation is essential for supporting ClickOnce applications. Traditionally,
applications are activated through a reference to an assembly that contains the application's
entry point.
•Windows Forms-Related Features
•ClickOnce Deployment
•Application Settings
•New Data-Binding Model
•New Windows Forms Controls
•The .NET Framework 2.0 provides many enhancements, including a new XSL Transformation
(XSLT) processor; type support in the XmlReader, XmlWriter, and XPathNavigator classes; and
new editing capabilities in the XPathNavigator class.
*END*
37
Overview of
Windows CardSpace, WPF, WCF, WF
38
Four new technologies in .NET Framework 3.0
(formerly, WinFX)
39
Four new technologies in .NET Framework 3.0
(formerly, WinFX)
40
Windows CardSpace
• lets any Windows application give its users a common
way to work with digital identities
• Enables users to provide their digital identity to online
services in a simple, secure and trusted way.
• Available for Windows Vista, Windows XP, and Windows
Server 2003
• Different roles in the digital identity system
– User
– Identity Provider
– Relying Party
Digital identities come in all shapes and sizes. An e-mail account with Yahoo - identified by an
e-mail address. Accounts in Various commercial organizations, such as Amazon or eBay –
identified by a username or at work - identified by your network login.
Every digital identity is associated with some information. When transmitted on the network,
every digital identity is represented by some kind of security token like username, X.509
certificates, and Kerberos tickets
Infocard contains information like what identity provider to contact to acquire a security token
for this identity, what kind of tokens this identity provider can issue, and exactly what claims
these tokens can contain. T he terms commonly used are –
1. User—Also known as the subject, the user is the entity that is associated with a digital
identity. Users
are often people, but organizations, applications, machines, and other things can also have
digital identities.
2. Identity provider—An identity provider is just what the name suggests: something that
provides a digital identity for a user. For the digital identity assigned to you by your
employer, for example, the identity provider is typically a system such as Active Directory.
For the digital identity you use with Amazon, the identity provider is effectively you, since
you define your own username and password.
3. Relying party—A relying party is an application that in some way relies on a digital identity.
A relying party will frequently use an identity (that is, the information contained in the claims
that make up this identity's security token) to authenticate a user, and then make an
authorization decision, such as allowing this user to access some information. A relying
party might also use the identity to get a credit card number, to verify that the same user is
accessing it at different times, or for other purposes. Typical examples of relying parties
include Internet websites such as online bookstore and auction sites, and any application
that accepts requests through Web services.
*CONT.*
41
Windows CardSpace Continued…
• A digital identity is represented by an InfoCard that the
user can present to a relying party
• An infocard along with visual representation contains
information about a particular digital identity
• CardSpace allows replacing password-based Web login
with a stronger mechanism.
Digital identities come in all shapes and sizes. An e-mail account with Yahoo - identified by an
e-mail address. Accounts in Various commercial organizations, such as Amazon or eBay –
identified by a username or at work - identified by your network login.
Every digital identity is associated with some information. When transmitted on the network,
every digital identity is represented by some kind of security token like username, X.509
certificates, and Kerberos tickets
Infocard contains information like what identity provider to contact to acquire a security token
for this identity, what kind of tokens this identity provider can issue, and exactly what claims
these tokens can contain. T he terms commonly used are –
1. User—Also known as the subject, the user is the entity that is associated with a digital
identity. Users
are often people, but organizations, applications, machines, and other things can also have
digital identities.
2. Identity provider—An identity provider is just what the name suggests: something that
provides a digital identity for a user. For the digital identity assigned to you by your
employer, for example, the identity provider is typically a system such as Active Directory.
For the digital identity you use with Amazon, the identity provider is effectively you, since
you define your own username and password.
3. Relying party—A relying party is an application that in some way relies on a digital identity.
A relying party will frequently use an identity (that is, the information contained in the claims
that make up this identity's security token) to authenticate a user, and then make an
authorization decision, such as allowing this user to access some information. A relying
party might also use the identity to get a credit card number, to verify that the same user is
accessing it at different times, or for other purposes. Typical examples of relying parties
include Internet websites such as online bookstore and auction sites, and any application
that accepts requests through Web services.
*CONT.*
42
This slide is intentionally left blank for the notes continued
from the previous slide
43
How it works?
www.microsoft.com
44
Windows Presentation Foundation
(formally known as “Avalon”)
A high percentage of classes in WPF inherit from the
following four "building block" classes:
– UIElement
– FrameworkElement
– ContentElement
– FrameworkContentElement
• A productive, unified approach to UI, Media, and
Documents that you can use to deliver unmatched user
experiences to your customers.
• The next-generation Windows smart-client UI technology
• Offers a sophisticated visual toolbox to create a great
user experience that scales to different form factors
• Works on Windows Vista, Windows XP and Windows
Server 2003
These four classes are typically referred to as the base element classes because they form
the basis of a common model for composing user interface (UI).
In WPF, a UI is composed of elements that are assembled in a tree hierarchy, which is
known as an element tree. The element tree provides a logical and intuitive way for you to
create user interfaces (UIs). It is also a structure over which you can layer more powerful UI
services.
One UI service is the dependency property system, which enables one element to implement
a property whose value is automatically shared with its child elements in the element tree.
For example, this property system enables the background color of a window to be
automatically applied to all child elements of windows that do not specify their own
background color.
Another service that takes advantage of the element tree is the routed event system. The
Microsoft .NET Framework version 3.0 provides direct events, which are only raised on one
element. Routed events, however, can traverse the element tree in a route between the root
element and the originator of the event; they can be handled by any element along the route.
One type of routed event bubbles up the tree from the originator, which gives all parent
elements the option of handling the event. Another type of routed event tunnels down to the
originator to provide an opportunity for all parent elements of the originator to preview the
event.
The main reason to handle events is to capture and process user input. The WPF input
system incorporates direct and routed events for this purpose. It also adds more support for
text input, focus management, and mouse positioning.
Just as the input system operates directly over input devices, the commanding system
provides a layer of abstraction that separates input actions from the code that responds to
those actions. The commanding system is modeled on the familiar command design pattern.
*CONT.*
45
Windows Presentation Foundation
(formally known as “Avalon”)
Declarative programming (XAML) for better designer-
developer collaboration
• Common code base and flexible deployment as stand-
alone client or in browser
• Interoperability with Windows Forms, Win32, DirectX,
MFC, ActiveX
• Increases Developer – Designer productivity
These four classes are typically referred to as the base element classes because they form
the basis of a common model for composing user interface (UI). For more information, see
Base Elements Overview.
In WPF, a UI is composed of elements that are assembled in a tree hierarchy, which is
known as an element tree. The element tree provides a logical and intuitive way for you to
create user interfaces (UIs). It is also a structure over which you can layer more powerful UI
services..
One UI service is the dependency property system, which enables one element to implement
a property whose value is automatically shared with its child elements in the element tree.
For example, this property system enables the background color of a window to be
automatically applied to all child elements of windows that do not specify their own
background color.
Another service that takes advantage of the element tree is the routed event system. The
Microsoft .NET Framework version 3.0 provides direct events, which are only raised on one
element. Routed events, however, can traverse the element tree in a route between the root
element and the originator of the event; they can be handled by any element along the route.
One type of routed event bubbles up the tree from the originator, which gives all parent
elements the option of handling the event. Another type of routed event tunnels down to the
originator to provide an opportunity for all parent elements of the originator to preview the
event.
The main reason to handle events is to capture and process user input. The WPF input
system incorporates direct and routed events for this purpose. It also adds more support for
text input, focus management, and mouse positioning.
Just as the input system operates directly over input devices, the commanding system
provides a layer of abstraction that separates input actions from the code that responds to
those actions. The commanding system is modeled on the familiar command design pattern.
*CONT.*
46
This slide is intentionally left blank for the notes continued
from the previous slide
47
WPF
XAML C# VB.NET
<Button Width="100"> OK Button b1 = new Button(); Dim b1 As New Button
<Button.Background> b1.Content = "OK"; b1.Content = "OK"
LightBlue b1.Background = new b1.Background = New _
</Button.Background> SolidColorBrush(Colors.LightBlue); SolidColorBrush(Colors.LightBlue)
</Button> b1.Width = 100; b1.Width = 100
www.microsoft.com
C# code-behind file
using…
namespace Button
{
public partial class Default : Panel
{ // Event handler
void Button_Click (object sender, System.Windows.Controls.ClickEventArgs e)
{ btn1.Background = System.Windows.Media.Brushes.Red; }
*END*
48
Windows Presentation Foundation / Everywhere
(WPF/E)
49
Overview of WCF
(formerly, called Indigo)
50
Windows Communication Foundation
A problem Example
http://msdn2.microsoft.com/en-us/library/ms731082.aspx
Over its lifetime, a rental car reservation application will likely be accessed by a range of other
applications. When it is designed, however, the architects of the rental car reservation application
know that its business logic will be accessed, as shown in the figure, by three other kinds of
software:
A call center client application running on the Windows desktops that are used by employees in
the organization’s call center. Created specifically for the new reservations system, this
application will also be built using the Microsoft .NET Framework and WCF. This application is
not truly distinct from the new rental car reservation application, because its only purpose is to act
as a client for the new system. From a service-oriented perspective, it is just another client for the
reservation system’s business logic.
An existing reservation application built on a J2EE server running on a non-Windows system.
Due to a recent merger with another car rental firm, this existing system must be able to access
the new application’s logic to provide customers of the merged firms with a unified experience.
Partner applications running on a variety of platforms, each located within a company that has a
business arrangement with the car rental firm. Partners might include travel agencies, airlines,
and others that have a business requirement to make car rental reservations.
Diverse communication requirements for the new rental car reservation application:
•With the call center client application, higher performance & straightforward interoperability are
the goals
•With the existing J2EE-based reservation application and with the diverse partner applications,
interoperability becomes the highest goal
Different security & transactional requirements are to be met without exposing the creators of the
new application to unmanageable complexity.
*END*
51
Addressing the Problem
http://msdn2.microsoft.com/en-us/library/ms731082.aspx
In the absence of WCF, the development team that implements the rental car application
would need to choose the right distributed technology from the multiple choices offered by
the .NET Framework. Yet given the diverse requirements of this application, no single
technology would fit the requirements. Instead, the application would probably use multiple
existing .NET Framework technologies, such as the following:
1. ASMX (also called ASP.NET Web Services) along with Web Services
Enhancements (WSE) for more secure communication with J2EE-based applications,
2. .NET Remoting for tightly-coupled .NET-to-.NET communication ,
3. Enterprise Services to manage object lifetimes and distributed transactions,
4. Microsoft Message Queuing (MSMQ) to talk with Windows-based partner
applications
The rental car reservation application can, instead use a single technology – WCF for all of its
application-to-application communication. This is how WCF addresses each of these
requirements:
• Because WCF can communicate using Web services, interoperability with other platforms
that also support SOAP, such as the leading J2EE-based application servers, is
straightforward.
• WCF can also be configured and extended to communicate with Web services using
messages not based on SOAP, for example, simple XML formats like RSS.
• To allow optimal performance when both parties in a communication are built on WCF, the
wire encoding used in this case is an optimized binary version of an XML Information Set.
Messages still conform to the data structure of a SOAP message, but their encoding uses a
binary representation of that data structure rather than the standard angle-brackets-and-text
format of the XML 1.0 text encoding. Using this option makes sense for communicating with
the call center client application, because it is also built on WCF, and performance is an
important concern.
*CONT.*
52
This slide is intentionally left blank for the notes continued
from the previous slide
53
WCF Architecture
WCF Services expose a collection of Endpoints where each Endpoint is a portal for
communicating with the world. Each Endpoint has an Address, a Binding, and a Contract
(ABC). The Address is where the Endpoint resides, the Binding is how the Endpoint
communicates, and the Contract is what the Endpoint communicates.
•Here’s a high-level view of the WCF architecture. At the top is your code, the code you’re
developing in Visual Studio or your environment.
•The WCF service uses an address (like “http://localhost”), a binding that determines how
the service communicates, and a contract that specifies what operations the service can
carry out.
•The binding consists of modules that specify how the service communicates, such as
• which transport the service communicates on, whether http, tcp, etc
• what encoder the service uses, like a text/XML encoder, a binary encoder, or a
custom encoder
• what kind of security the service requires
• and any other communication requirements.
• When a message comes into the service, it is taken off the transport
• decoded with the proper decoder
• security is negotiated away
• and then the message is dispatched to the appropriate part of your code.
*END*
54
Windows Workflow Foundation
55
Windows Workflow Foundation
http://msdn2.microsoft.com/en-us/library/aa349006.aspx
56 ER/CORP/CRS/LA31/003 We enable you to leverage knowledge
anytime, anywhere!
The above illustration shows how workflows, activities, and the workflow runtime engine
are all hosted in process with a host application.
Workflow Models trace the path of activities for each identified business process from the
time the customer requests for a service (input) or when an output is required (for example,
"Create Garment"), through the participants, till the ultimate deliverables are produced.
56
.NET Framework in context
http://msdn2.microsoft.com/en-us/library/zw4w595w.aspx
57
Advantages of .NET Framework
58
Simplify Deployment …
• No registration required
– Code is completely self-describing
– Simply copy components to app dir
• Zero-impact install
– Installing one app will not affect another
• Side-by-side execution
– Multiple component versions can co-exist
• Assemblies
– Contain dependency information
•You don’t have to register your dot net component in the registry like earlier
components. This helps overcome the dll hell problem which didn’t allow two
simultaneous versions of the same component to be registered in the registry.
•All assemblies are private by default. So installing one application will not affect
another. If we need to share assemblies across different clients then we need to
deploy this into Global Assembly Cache (GAC). Microsoft has provided a tool
GACUTIL.exe for deploying into GAC. We need to sign the assembly with a strong
name before putting it into GAC. To generate strong name Microsoft has provided a
tool sn.exe. Use this strong name and deploy into GAC. You can have multiple
versions in GAC. Version information and key information is stored in the
AssemblyInfo file.
*END*
59
Simplify Development
60
How Much Simpler?
Windows API
HWND hwndMain = CreateWindowEx(
0, "MainWClass", "Main Window",
WS_OVERLAPPEDWINDOW | WS_HSCROLL | WS_VSCROLL,
CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT,
(HWND)NULL, (HMENU)NULL, hInstance, NULL);
ShowWindow(hwndMain, SW_SHOWDEFAULT);
UpdateWindow(hwndMain);
.NET Framework
Form form = new Form();
form.Text = "Main Window";
form.Show();
61
A Unified Programming Model
http://www.inf.pucminas.br/sblp2003/sblp2003_files/dotnet.pdf
•Microsoft has taken all good things from VB, ASP and MFC/ATL such as automatic
forms generation and easy component development as in VB, generation of
multithreaded, high performance component as in case of MFC/ATL COM and web
development using ASP and incorporated all the good things from these three into
.NET framework.
•Microsoft has incorporated libraries of classes into .NET framework. This is very
much needed. In case of up to VB6.0 there were no inbuilt classes. Developers
used to create classes and reuse this across projects but nothing was given as part
of IDE. This drawback has been addressed in .NET.
•All components created using any .net language has the same power as any other
.net language. There is no step mother treatment for components based on the
language being used to create the same.
*END*
62
Summary
XML Web services
.NET Language
•Expose functionality as
Web
Support Forms
service
•ASP.NET
The
•Common
Runtime
Familiar
No needdrag
to
Language
is language
and
learn drop
XML
neutral
Runtime
Server-
Server -side Web Forms and
Web •
Web development
Interface
Common Services is components
language automatically
Manages running code
specification
•ADO.NET Classes
generated
Separate
Separates
Framework
Fine-
code
Fine-grained
fromcode
UI and content
evidence-
evidence-
Microsoft is providing:
••
Compiled
Seamless
based deployment
security
XML
Build
Spans Web
data-
data
Visual services
-driven
all Basic,
programmingapplications
C++, C#,
No-
No -touch
No--touch
NoXML deployment
deploymentsystem
•
using
languages
Reuse
JScript™
JScript
consumption
Intelligent
™existing
state
Web
management
Object
Program
Services
Object-
Object remoting
against
-oriented and with
your objects
Third-
Third -parties are building:
SOAP
Controls
consistent sense client and
Easily pass data across
•APL,
VS.NET
adapt COBOL,
output: generates
HTML, thethe
Pascal,
DHTML,
wire
Commonand Haskell,
Eiffel, between platforms
type system
ML, built-
built-in
Oberon,
WML
plumbing
with XML
Perl, Python, Scheme,
Extensible
•
Relational
Smalltalk,andObjective
unstructured
Full IntelliSense
Secure
CAML,
support
data
…
•Build and consume with any
Inside the .NET Framework VS language
63
This slide is intentionally left blank for the notes continued
from the previous slide
64
References
• Microsoft.com .NET site (http://www.microsoft.com/net):
The definitive resource for what .NET is and why it matters.
• Virtual labs at
http://msdn.microsoft.com/virtuallabs/netframe/default.aspx
65
Thank You
“The contents of this document are proprietary and confidential to Infosys Technologies Ltd. and may
not be disclosed in whole or in part at any time, to any third party without the prior written consent of
Infosys Technologies Ltd.”
“© 2007 Infosys Technologies Ltd. All rights reserved. Copyright in the whole and any part of this
document belongs to Infosys Technologies Ltd. This work may not be used, sold, transferred, adapted,
abridged, copied or reproduced in whole or in part, in any manner or form, or in any media, without the
prior written consent of Infosys Technologies Ltd.”
66