Sei sulla pagina 1di 40

ISAS PRESENTATION

ON
.NET FRAMEWORK

Submitted by submitted to
Virender Bhati Preety Sisodiya
Certificate

This is to certified that this report is entitled to introduction to an .NET


FRAMEWORK an original work of Virender. It is further certified that we
have done our work under guidance & supervision to the best of our
knowledge. We have done this by consulting various sources related to
topic.

Mr. Mukesh Bansal Miss. Preety Sisodiya


(Director) (Faculty)

Date:

2 Cont…
Acknowledgement

Presenting the project report in present form, be sincerely feel to


acknowledge many individuals who have contributed to the development of
this project report we would like to thank the entire NIIT faculty for their
invaluable help.

A special thanks to Miss Preety Sisodiya (faculty) who


gave their valuable time & efforts for our report preparation.

We are certain that this report will satisfy everybodies


expectations.

Virender bhati

3 Cont…
Tabel of Contents

Why .NET required?..............................................................................................................................5


Design goals and principal features...................................................................................................5
MICROSOFT .NET FRAMEWORK....................................................................................................7
Significance.......................................................................................................................................9
.NET Framework architecture.........................................................................................................10
Common Language Infrastructure (CLI)......................................................................................12
Client Application Development..................................................................................................13
Server Application Development..................................................................................................14
Assemblies....................................................................................................................................20
Metadata.......................................................................................................................................21
Base Class Library (BCL)............................................................................................................21
Security............................................................................................................................................22
Standardization and licensing..........................................................................................................22
Versions............................................................................................................................................23
.NET Framework 1.0....................................................................................................................23
.NET Framework 1.1....................................................................................................................24
.NET Framework 2.0....................................................................................................................24
.NET Framework 3.0....................................................................................................................25
NET vs. Java and the J2EE..............................................................................................................27
Criticism..........................................................................................................................................28
Alternative implementations............................................................................................................29
Base Class Library...............................................................................................................................30
Namespaces.....................................................................................................................................31
.NET Languages..................................................................................................................................35
Microsoft .NET languages...............................................................................................................36
ADO.NET............................................................................................................................................37
ASP.NET..............................................................................................................................................37
ASPX file format.............................................................................................................................37
Other files.....................................................................................................................................38
Performance.....................................................................................................................................39

4 Cont…
Why .NET required?

The creation of the .NET Framework reflects what has been learned over the years
about the typical challenges that programmers face and useful approaches to those
challenges.

Individual programming languages and tools led the way in proving the viability of
features such as strong data typing, garbage-collected memory management,
exception-based error handling, virtual machine architectures, and comprehensive
class libraries. Visual Basic, Powerbuilder, the C++ Standard Template Library (STL),
and other languages each implemented at least some of these features, but the Java
language and its frameworks J2SE and J2EE became the most notable competitive
threat to Microsoft. After failed attempts to include a modified form of Java with
Windows, Microsoft set out to create its own products that incorporated the best
features of that and other languages. The effort resulted in the Microsoft .NET
Framework and its accompanying programming languages and tools.

Design goals and principal features

The .NET Framework was designed with several intentions:

5 Cont…
• Interoperability - Because interaction between new and older applications is
commonly required, the .NET Framework provides means to access
functionality that is implemented in programs that execute outside the .NET
environment. Access to COM components is provided in the EnterpriseServices
namespace of the framework, and access to other functionality is provided using
the P/Invoke feature.

• Common Runtime Engine - Programming languages on the .NET


Framework compile into an intermediate language known as the Common
Intermediate Language, or CIL; Microsoft's implementation of CIL is known as
Microsoft Intermediate Language, or MSIL. In Microsoft's implementation, this
intermediate language is not interpreted, but rather compiled in a manner known
as just-in-time compilation (JIT) into native code. The combination of these
concepts is called the Common Language Infrastructure (CLI), a specification;
Microsoft's implementation of the CLI is known as the Common Language
Runtime (CLR).

• Language Independence - The .NET Framework introduces a Common Type


System, or CTS. The CTS specification defines all possible datatypes and
programming constructs supported by the CLR and how they may or may not
interact with each other. Because of this feature, the .NET Framework supports
development in multiple programming languages. This is discussed in more
detail in the .NET languages section below.

• Base Class Library - The Base Class Library (BCL), sometimes referred to as
the Framework Class Library (FCL), is a library of types available to all
languages using the .NET Framework. The BCL provides classes which
encapsulate a number of common functions, including file reading and writing,
graphic rendering, database interaction and XML document manipulation.

6 Cont…
• Simplified Deployment - Installation of computer software must be carefully
managed to ensure that it does not interfere with previously installed software,
and that it conforms to increasingly stringent security requirements. The .NET
framework includes design features and tools that help address these
requirements.

• Security - .NET allows for code to be run with different trust levels without the
use of a separate sandbox.

The design of the .NET Framework is such that it supports platform independence.
That is, a program written to use the framework should run without change on any
type of computer for which the framework is implemented. At present, Microsoft has
implemented the full framework only on the Windows operating system. Microsoft
and others have implemented portions of the framework on non-Windows systems, but
to date those implementations are neither complete nor widely used.

MICROSOFT .NET FRAMEWORK

The Microsoft .NET Framework is a software component that can be added to the
Microsoft Windows operating system.The .NET framework defines an enviornments
that support the development and execution of highly distributed, component based
applications. It enables differing computer languages to work together and provides for
security, program protability, and a common programming model for the Windows
platform. It is important to state, however, that the .NET Framework is not inherently
limited to Windows, which means that programs written for it might be portable to non
Windows environments in the future.

7 Cont…
The .NET Framework defines two very important entities. The First is the
common language runtime (CLR). This is the system that manages the execution of
your program. Along with other benefits, the CLR is the part of the .NET Framework
that enables programs to be protable, supports mixed-language programming, and
provides for security.

The second entity is the .NET class library. This library gives your progarm
access to the runtime environment. For example, if you want to perform I/O, such as
displaying something on the screen, you will use the .NET Class library to do it.
Feature which is defines by .NET class library that it can run any where that the .NET
run time system is supported. Thus the programmes are automatically portable to all
.NET environment. It provides a large body of pre-coded solutions to common
program requirements, and manages the execution of programs written specifically for
the framework. The .NET Framework is a key Microsoft offering, and is intended to
be used by most new applications created for the Windows platform.

The Microsoft .NET Framework is a platform for building, deploying, and running
Web Services and applications. It provides a highly productive, standards-based,
multi-language environment for integrating existing investments with next-generation
applications and services as well as the ability to solve the challenges of deployment
and operation of Internet-scale applications.

The pre-coded solutions form the framework's class library and cover a large
range of programming needs in areas including: user interface, data access, database
connectivity, cryptography, web application development, numeric algorithms, and
network communications. The functions of the class library are used by programmers
who combine them with their own code to produce applications.

The .NET Framework consists of three main parts:

 The common language runtime,


 A hierarchical set of unified class libraries
 A componentized version of Active Server Pages called ASP.NET.

8 Cont…
Programs written for the .NET Framework execute in a software environment
that manages the program's runtime requirements. This runtime environment, which is
also a part of the .NET Framework, is known as the Common Language Runtime
(CLR).

 The CLR provides the appearance of an application virtual machine, so


that programmers need not consider the capabilities of the specific CPU
that will execute the program.
 The CLR also provides other important services such as security
mechanisms, memory management, and exception handling.
 The class library and the CLR together compose the .NET Framework.
The Framework is intended to make it easier to develop computer
applications and to reduce the vulnerability of applications and computers
to security threats.
 CLR manages the execution of .NET code whenever user compile a .NET
program the output of compiler is not executable code instead it is a file
that contain a special types of pseudo code called Microsoft intermediate
language (MSIL).
 It is the job of CLR to translate the intermediate code into executable
code when a progarm is run.

First released in 2002, it is included with Windows Server 2003 and Windows Vista,
and can be installed on most older versions of Windows.

Significance
For software developers, the .NET Framework is a significant change. It brings into
the operating system features and responsibilities that previously had been provided
individually by programming languages and tools from various sources. The
incorporation of the features into the operating system is meant to provide a number of
advantages, including:

9 Cont…
• Assuring the availability of framework features to all programs written in any of
the .NET languages.

• Providing to programmers a common means of accessing framework features,


regardless of programming language.

• Guarantees of a common behavior within the framework, regardless of


programming language.

• Allowing the operating system to provide some guarantees of program behavior


that it otherwise could not offer.

• Reducing the complexity and limitations of program-to-program


communication, even when those programs are written in different .NET
languages.

.NET Framework architecture

10 Cont…
11 Cont…
Visual overview of the Common Language Infrastructure (CLI)

Common Language Infrastructure (CLI)

The most important component of the .NET Framework lies in the Common Language
Infrastructure, or CLI. The purpose of the CLI is to provide a language-agnostic
platform for application development and execution, including, but not limited to,
components for exception handling, garbage collection, security, and interoperability.
Microsoft's implementation of the CLI is called the Common Language Runtime, or
CLR. The CLR is composed of five primary parts:

.NET Framework Class Library


The .NET Framework class library is a collection of reusable types that tightly
integrate with the common language runtime. The class library is object oriented,
providing types from which your own managed code can derive functionality. This not
only makes the .NET Framework types easy to use but also reduces the time
associated with learning new features of the .NET Framework. In addition, third-party
components can integrate seamlessly with classes in the .NET Framework.

For example, the .NET Framework collection classes implement a set of interfaces that
you can use to develop your own collection classes. Your collection classes will blend
seamlessly with the classes in the .NET Framework.

As you would expect from an object-oriented class library, the .NET Framework types
enable you to accomplish a range of common programming tasks, including string
management, data collection, database connectivity, and file access. In addition to
these common tasks, the class library includes types that support a variety of
specialized development scenarios. For example, you can use the .NET Framework to
develop the following types of applications and services:

• Console applications
• Windows GUI applications (Windows Forms)

12 Cont…
• ASP.NET applications
• XML Web services
• Windows services

For example, the Windows Forms classes are a comprehensive set of reusable types
that vastly simplify Windows GUI development. If you write an ASP.NET Web Form
application, you can use the Windows Forms classes.

Client Application Development

Client applications are the closest to a traditional style of application in Windows-


based programming. These are the types of applications that display windows or forms
on the desktop, enabling a user to perform a task. Client applications include
applications such as word processors and spreadsheets, as well as custom business
applications such as data entry and reporting tools. Client applications usually employ
windows, menus, buttons, and other GUI elements, and they likely access local
resources, such as the file system, and peripherals such as printers.

Another kind of client application is the traditional ActiveX control (now replaced by
the managed Windows Forms control) deployed over the Internet as a Web page. This
application is much like other client applications: it is executed natively, has access to
local resources, and includes graphical elements.

In the past, developers created such applications using C or C++ in conjunction with
the Microsoft Foundation Classes (MFC) or with a rapid application development
(RAD) environment such as Microsoft® Visual Basic®. The .NET Framework
incorporates aspects of these existing products into a single, consistent development
environment that drastically simplifies the development of client applications.

The Windows Forms classes contained in the .NET Framework are designed to be
used for GUI development. You can easily create command windows, buttons, menus,
toolbars, and other screen elements with the flexibility necessary to accommodate
shifting business needs.

13 Cont…
For example, the .NET Framework provides simple properties to adjust visual
attributes associated with forms. In some cases, the underlying operating system does
not support changing these attributes directly, and in these cases the .NET Framework
automatically re-creates the forms. This is one of many ways in which the .NET
Framework integrates the developer interface, making coding simpler and more
consistent.

Unlike ActiveX controls, Windows Forms controls have semitrusted access to a user's
computer. This means that binary or natively executing code can access some of the
resources on the user's system, such as GUI elements and limited file access, without
being able to access or compromise other resources. Because of code access security,
many applications that once needed to be installed on a user's system can now be
safely deployed through the Web. Your applications can implement the features of a
local application while being deployed like a Web page.

Server Application Development


Server-side applications in the managed world are implemented through runtime hosts.
Unmanaged applications host the common language runtime, which allows your
custom managed code to control the behavior of the server. This model provides you
with all the features of the common language runtime and class library while gaining
the performance and scalability of the host server.

The following illustration shows a basic network schema with managed code running
in different server environments. Servers, such as IIS and SQL Server, can perform
standard operations while your application logic executes the managed code.

Server-side managed code

14 Cont…
ASP.NET is the hosting environment that enables developers to use the .NET
Framework to target Web-based applications. However, ASP.NET is more than just a
runtime host; it is a complete architecture for developing Web sites and Internet-
distributed objects using managed code. Both Web Forms and XML Web services use
IIS and ASP.NET as the publishing mechanism for applications, and both have a
collection of supporting classes in the .NET Framework.

XML Web services, an important evolution in Web-based technology, are distributed,


server-side application components similar to common Web sites. However, unlike
Web-based applications, XML Web services components have no UI and are not
targeted for browsers such as Internet Explorer and Netscape Navigator. Instead, XML
Web services consist of reusable software components designed to be consumed by
other applications, such as traditional client applications, Web-based applications, or
even other XML Web services. As a result, XML Web services technology is rapidly
moving application development and deployment into the highly distributed
environment of the Internet.

If you have used earlier versions of ASP technology, you will immediately notice the
improvements that ASP.NET and Web Forms offer. For example, you can develop Web
Forms pages in any language that supports the .NET Framework. In addition, your
code no longer needs to share the same file with your HTTP text (although it can
continue to do so if you prefer). Web Forms pages execute in native machine language
because, like any other managed application, they take full advantage of the runtime.

15 Cont…
In contrast, unmanaged ASP pages are always scripted and interpreted. ASP.NET
pages are faster, more functional, and easier to develop than unmanaged ASP pages
because they interact with the runtime like any managed application.

The .NET Framework also provides a collection of classes and tools to aid in
development and consumption of XML Web services applications. XML Web services
are built on standards, such as SOAP, a remote procedure-call protocol; XML, an
extensible data format; and WSDL, the Web Services Description Language. The
.NET Framework is built on these standards to promote interoperability with non-
Microsoft solutions.

For example, the Web Services Description Language tool included with the .NET
Framework SDK can query an XML Web service published on the Web, parse its
WSDL description, and produce C# or Visual Basic source code that your application
can use to become a client of the XML Web service. The source code can create
classes derived from classes in the class library that handle all the underlying
communication using SOAP and XML parsing. Although you can use the class library
to consume XML Web services directly, the Web Services Description Language tool
and the other tools contained in the SDK facilitate your development efforts with the
.NET Framework.

If you develop and publish your own XML Web service, the .NET Framework
provides a set of classes that conform to all the underlying communication standards,
such as SOAP, WSDL, and XML. Using those classes enables you to focus on the
logic of your service, without concerning yourself with the communications
infrastructure required by distributed software development.

Finally, like Web Forms pages in the managed environment, your XML Web service
will run with the speed of native machine language using the scalable communication
of Internet Information Services IIS.

16 Cont…
• Common Type System (CTS)
• Common Language Specification (CLS)
• Common Intermediate Language (CIL)
• Just-in-Time Compiler (JIT)
• Virtual Execution System (VES)

The Common Type System (CTS) is used by every language built on the .NET
Framework. A fundamental part of the .NET Framework is Common Language
Runtime (CLR), the CTS specifies no particular syntax or keywords, but instead
defines a common set of types that can be used with many different language syntaxes.
Each language is free to define any syntax it wishes, but if that language is built on the
CLR, it will use at least some of the types defined by the CTS. While the creator of a
CLR-based language is free to implement only a subset of the types defined by the
CTS. Visual Basic.NET, C#, and pretty much every other language used with the .NET
Framework rely heavily on the CTS.

The CTS provides every language running on the .NET platform with a base set of
data types. While the CTS is responsible for defining the types that can be used across
the .NET languages, most languages choose to implement aliases to those types. For
example, a four-byte integer value is represented by the CTS type System.Int32. C#
defines an alias for this called type called int.

Everything in the CTS is an object. Not only is everything an object but even more
importantly, all objects implicitly derive from a single base class defined as a part of
the CTS. This base class is called System.Object. The designers of CTS were faced
with the task of creating a type system in which every thing is an object, but the type
system works in an efficient manner, when applicable

17 Cont…
The Common Language Infrastructure (CLI) is an open specification developed by
Microsoft that describes the executable code and runtime environment that form the
core of the Microsoft .NET Framework. The specification defines an environment that
allows multiple high-level languages to be used on different computer platforms
without being rewritten for specific architectures.

To clarify, the CLI is a specification, not an implementation, and is often confused


with the Common Language Runtime (CLR), which contains aspects outside the scope
of the specification.

Common Intermediate Language (CIL) (formerly called Microsoft Intermediate


Language or MSIL) is the lowest-level human-readable programming language in the
Common Language Infrastructure and in the .NET Framework. Languages which
target the .NET Framework compile to CIL, which is assembled into bytecode. CIL
resembles an object oriented assembly language, and is entirely stack-based. It is
executed by a virtual machine. The primary .NET languages are C#, Visual Basic
.NET, C++/CLI, and J#.

CIL was originally known as Microsoft Intermediate Language (MSIL) during the beta
releases of the .NET languages. Due to standardization of C# and the Common
Language Infrastructure, the bytecode is now officially known as CIL. Because of this
legacy, CIL is still frequently referred to as MSIL, especially by long-standing users of
the .NET languages.

18 Cont…
In computing, just-in-time compilation (JIT), also known as dynamic translation, is
a technique for improving the runtime performance of a computer program. It
converts, at runtime, code from one format into another, for example bytecode into
native machine code. The performance improvement originates from caching the
results of translating blocks of code, and not simply evaluating each line or operand
separately (see Interpreted language), or compiling the code at development time. JIT
builds upon two earlier ideas in run-time environments: bytecode compilation and
dynamic compilation

In a bytecode-compiled system, source code is translated to an intermediate


representation known as bytecode. Bytecode is not the machine code for any particular
computer, and may be portable among computer architectures. The bytecode is then
interpreted, or run on a virtual machine.

A dynamic compilation environment is one in which the compiler can be used during
execution. For instance, most Common Lisp systems have a compile function which
can compile new functions created during the run. While advantageous in interactive
debugging, dynamic compilation is less useful in a hands-off deployed system.

In a JIT environment, bytecode compilation is the first step, reducing source code to a
portable and optimizable intermediate representation. The bytecode is deployed onto
the target system. When code is executed, the runtime environment's compiler
translates it into native machine code. This can be done on a per-file, per-function or
even on any arbitrary code fragment; code can be compiled when it is about to be
executed (hence the name "just-in-time").

The goal is to combine many of the advantages of native and bytecode compilation:
Much of the "heavy lifting" of parsing the original source code and performing basic
optimization is handled at compile time, prior to deployment: compilation from
bytecode to machine code is much faster than from source. The deployed bytecode is
portable, unlike machine code for any given architecture. Compilers from bytecode to
machine code are easier to write, because the portable bytecode compiler has already
done much of the work.

19 Cont…
This also generally offers far better performance than interpreters as the compiled code
is stored in memory cache at runtime, such that subsequent recompilation or
reinterpretation of compiled code can be skipped, while also giving flexibility to
automatically recompile and optimise code that is found at runtime to be frequently
executed.

However, JIT may have a drawback by causing a slight delay in initial execution of an
application, due to the time taken to compile the bytecode. Sometimes this delay is
called "startup time delay". In general, the more optimization JIT performs, the better
code it will generate. However, the longer delay users will experience. Therefore a
well written JIT has to make the trade-offs between the compilation time and the
quality of the code it hopes to generate.

The Virtual Execution System(VES) provides an environment for executing managed


code. It provides direct support for a set of built-in data types, defines a hypothetical
machine with an associated machine model and state, a set of control flow constructs,
and an exception handling model.To a large extent, the purpose of the VES is to
provide the support required to execute the Common Intermediate Language
instruction set.

Assemblies

The intermediate MSIL code is housed in .NET assemblies, which for the Windows
implementation means a Portable Executable (PE) file (EXE or DLL). Assemblies are

20 Cont…
the .NET unit of deployment, versioning and security. The assembly consists of one or
more files, but one of these must contain the manifest, which has the metadata for the
assembly. The complete name of an assembly contains its simple text name, version
number, culture and public key token; it must contain the name, but the others are
optional. The public key token is generated when the assembly is created, and is a
value that uniquely represents the name and contents of all the assembly files, and a
private key known only to the creator of the assembly. Two assemblies with the same
public key token are guaranteed to be identical. If an assembly is tampered with (for
example, by hackers), the public key can be used to detect the tampering.

Metadata

All CIL is self-describing through .NET metadata. The CLR checks on metadata to
ensure that the correct method is called. Metadata is usually generated by language
compilers but developers can create their own metadata through custom attributes

Base Class Library (BCL)

The Base Class Library (BCL), sometimes incorrectly referred to as the Framework
Class Library (FCL) (which is a superset including the Microsoft.* namespaces), is a
library of classes available to all languages using the .NET Framework. The BCL
provides classes which encapsulate a number of common functions such as file
reading and writing, graphic rendering, database interaction, XML document
manipulation, and so forth. The BCL is much larger than other libraries, but has much
more functionality in one package.

21 Cont…
Security

.NET has its own security mechanism, with two general features: Code Access
Security (CAS), and validation and verification. Code Access Security is based on
evidence that is associated with a specific assembly. Typically the evidence is the
source of the assembly (whether it is installed on the local machine, or has been
downloaded from the intranet or Internet). Code Access Security uses evidence to
determine the permissions granted to the code. Other code can demand that calling
code is granted a specified permission. The demand causes the CLR to perform a call
stack walk: every assembly of each method in the call stack is checked for the required
permission and if any assembly is not granted the permission then a security exception
is thrown.

When an assembly is loaded the CLR performs various tests. Two such tests are
validation and verification. During validation the CLR checks that the assembly
contains valid metadata and CIL, and it checks that the internal tables are correct.
Verification is not so exact. The verification mechanism checks to see if the code does
anything that is 'unsafe'. The algorithm used is quite conservative and hence
sometimes code that is 'safe' is not verified. Unsafe code will only be executed if the
assembly has the 'skip verification' permission, which generally means code that is
installed on the local machine.

Standardization and licensing

22 Cont…
In August, 2000, Microsoft, Hewlett-Packard, and Intel worked to standardize CLI and
the C# programming language. By December, 2001, both were ratified ECMA
standards (ECMA 335 and ECMA 334). ISO followed in April, 2003 (ISO/IEC 23271
and ISO/IEC 23270).

While Microsoft and their partners hold patents for CLI and C#, ECMA and ISO
requires that all patents essential to implementation be made available under
"reasonable and non-discriminatory (RAND) terms." In addition to meeting these
terms, the companies have agreed to make the patents available royalty-free.

However, this does not apply for the part of the .NET Framework which is not covered
by the ECMA/ISO standard, which includes Windows Forms, ADO.NET, and
ASP.NET. Patents that Microsoft holds in these areas may deter non-Microsoft
implementations of the full framework.

Versions

Microsoft started development on the .NET Framework in the late 90s originally under
the name of Next Generation Windows Services (NGWS). By late 2000 the first beta
versions of .NET 1.0 were being released.

.NET Framework 1.0

23 Cont…
This is the first release of the .NET Framework that was released on February 13,
2002. It is available on its own as a redistributable package or in a software
development kit. It is also part of the first release of Microsoft Visual Studio .NET
(also known as Visual Studio .NET 2002).

.NET Framework 1.1

This is the first major .NET Framework upgrade. It is available on its own as a
redistributable package or in a software development kit. It is also part of the second
release of Microsoft Visual Studio .NET (released as Visual Studio .NET 2003). This
is the first version of the .NET Framework to be included as part of the Windows
operating system - it is part of Windows Server 2003. Windows Server 2003 originally
shipped with the 1.1 RTM version.

Changes since 1.0

• Built-in support for mobile ASP.NET controls. Previously available as an add-


on for .NET Framework, now part of the framework.
• Security changes - enable Windows Forms assemblies to execute in a semi-
trusted manner from the Internet, and enable Code Access Security in ASP.NET
applications.
• Built-in support for ODBC and Oracle databases. Previously available as an
add-on for .NET Framework 1.0, now part of the framework.
• .NET Compact Framework - a version of the .NET Framework for small
devices.
• Internet Protocol version 6 (IPv6) support.
• Numerous API changes. For a detailed list, see GotDotNet: API Changes
between versions of the .NET Framework.

.NET Framework 2.0

24 Cont…
Released with Visual Studio .NET 2005, Microsoft SQL Server 2005 and BizTalk
2006.

• The 2.0 Redistributable Package can be downloaded for free from Microsoft.
• The 2.0 Software Development Kit (SDK) can be downloaded for free from
Microsoft.
• It is included as part of Visual Studio 2005 and Microsoft SQL Server 2005.
• Version 2.0 is the last version with support for Windows 2000

.NET Framework 2.0 shipped with Windows Server 2003 R2 (not installed by default).

Changes since 1.1

• Numerous API changes.


• A new hosting API for native applications wishing to host an instance of the
.NET runtime. The new API gives a fine grain control on the behavior of the
runtime with regards to multithreading, memory allocation, assembly loading
and more (detailed reference). It was initially developed to efficiently host the
runtime in Microsoft SQL Server, which implements its own scheduler and
memory manager.
• Full 64-bit support for both the x64 and the IA64 hardware platforms.
• Language support for Generics built directly into the .NET CLR.
• Many additional and improved ASP.NET web controls.
• New data controls with declarative data binding.
• New personalization features for ASP.NET, such as support for themes, skins
and webparts.
• .NET Micro Framework - a version of the .NET Framework related to the Smart
Personal Objects Technology initiative more....

.NET Framework 3.0

25 Cont…
Architecture of the .NET Framework 3.0

.NET Framework 3.0, formerly called WinFX,[3] includes a new set of managed code
APIs that are an integral part of Windows Vista and Windows Server "Longhorn"
operating systems. It is also available for Windows XP SP2 and Windows Server 2003
as a download. There are no major architectural changes included with this release;
.NET Framework 3.0 includes version 2.0 of the Common Language Runtime. The
.NET 3.0 installer available from Microsoft checks to see if .NET 2.0 is already
installed. If not, it installs it and then installs .NET 3.0 components. Otherwise it just
installs .NET 3.0 components. This means that if you do not have .NET 2.0 installed,
you do not need to install it; you can install .NET 3.0 straight away. .NET 1.1 and its
service-pack, however, must be installed separately, preferably before installing .NET
3.0.

.NET Framework 3.0 consists of four major new components:

• Windows Presentation Foundation (WPF), formerly code-named Avalon; a


new user interface subsystem and API based on XML and vector graphics,

26 Cont…
which will make use of 3D computer graphics hardware and Direct3D
technologies. See WPF SDK for developer articles and documentation on WPF.
• Windows Communication Foundation (WCF), formerly code-named Indigo;
a service-oriented messaging system which allows programs to interoperate
locally or remotely similar to web services.
• Windows Workflow Foundation (WF) allows for building of task automation
and integrated transactions using workflows.
• Windows CardSpace (WCS), formerly code-named 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

NET vs. Java and the J2EE

The CLI and C# have many similarities to Sun's JVM and Java. They are strong
competitors. Both are based on a virtual machine model that hides the details of the
computer hardware on which their programs run. Both use their own intermediate
byte-code, Microsoft calling theirs Microsoft Intermediate Language (MSIL) and Sun
Java bytecode. On .NET, the byte-code is always JIT-compiled: with Java, the byte-
code can be either interpreted or JIT-compiled. Both provide extensive class libraries
that address many common programming requirements, and both address many
security issues that are present in other approaches. The namespaces provided in the
.NET Framework closely resemble the platform packages in Java EE API
Specification both in style and invocation.

.NET in its complete form (Microsoft's implementation) is currently only fully


available on Windows platforms, whereas Java is fully available on many platforms.
.NET was built from the ground-up to support multiple programming languages while
targeting Microsoft Windows, while the Java platform was initially built to support

27 Cont…
only the Java language on many operating system platforms under the slogan, "Write
once, run anywhere."

Microsoft's reference implementation of .NET is closed source, whereas Sun's


reference implementation of Java is becoming GPL (including the class library, the
compiler, the virtual machine, and the various tools associated with the Java Platform).

However, the third-party Mono project is developing an open source implementation


of subsets of the .NET Framework, including the Common Language Runtime, for the
Linux, Solaris, Mac OS, and Windows platforms. The current version supports version
1.1 of .NET, and the project is planning full support for 2.0. Meanwhile, the Java
Virtual Machine environment is host to many alternative languages not supported by
Sun.

Criticism

Some concerns and criticisms relating to the .NET Framework include:

• With the introduction of the .NET framework, the old Visual Basic language
was replaced by the Visual Basic .NET language, which caused controversy
among transitioning developers.

• Several backward and forward incompatibilities exist between .NET 1.0, .NET
1.1, and .NET. These are well-documented however, and mostly include security
fixes, changes in the underlying implementation (such as the GetHashCode()
implementation), as well as marking many methods as Obsolete. Additionally,
the framework allows running different versions side-by-side, to alleviate
problems of version incompatibility.

• Applications running in a managed environment such as the Microsoft


framework's CLR or Java's JVM tend to require more system resources than
functionally similar applications that access machine resources more directly.
However, some applications have been shown to perform better in .NET than in
their native version. This could be due to the use of relatively well-performing
functions in the .NET framework, JITting of managed code, or other aspects of
the CLR.

28 Cont…
• Although it is more a business decision than a real criticism on the
framework, some people have expressed concern that the framework
is too much tied to the Microsoft Windows operating system. However, the
existence of alternative implementations for other platforms (though not yet
complete) begin to alleviate this criticism.

• There is also concern in the development community about the fact that a .NET
assembly, as produced by the .NET programming environments, can be reverse-
engineered to reveal some of the programming techniques and algorithms used
by an application. While this kind of reverse-engineering is possible with all
programs, those that compile to byte-code, as .NET and Java do, are somewhat
more vulnerable. Reverse engineering can lead to the loss of trade secrets and
the bypassing of license control mechanisms. Some developers are using
obfuscation and other techniques in an attempt to protect their intellectual
property and license revenues. Indeed Microsoft includes a tool called the
"dotfuscator community edition" - a product of PreEmptive Solutions, in the full
version of Visual Studio 2005.

• Microsoft has applied for patents on some parts of the Framеwork. An


agreement was made however between Microsoft and Novell whereby
Microsoft agreed to not sue Novell or its customers for patent infringement,
allowing the implementation of these parts in the open-source Mono
implementation of .NET. According to a statement on the blog of Mono project
leader Miguel de Icaza, this agreement extends to Mono but only for Novell
developers and users. It was criticized by the Open source community because it
violates the principles of giving equal rights to all users of a particular program
(see Patent Agreement with Microsoft). On February 2007, the Free Software
Foundation announced that it is reviewing Novell's right to sell GNU software,
which makes up much of a Linux operating system, because of this
agreement..However Eben Moglen later said that he was quoted out of context,
and referring to possible changes that could made to the GPL version 3, that
would block similar deals in the future

Alternative implementations

29 Cont…
The Microsoft .NET Framework is the predominant implementation of .NET
technologies. Other implementations for parts of the framework exist. Since the
runtime engine is described by a ECMA/ISO specification, other implementations of it
are unencumbered by copyright issues. It is more difficult to develop alternatives to
the base class library (BCL), which is not described by an open standard, and may be
subject to copyright restrictions. Additionally, parts of the BCL have Windows-specific
functionality and behavior, so implementation on non-Windows platforms can be
problematic.

Some alternative implementations of parts of the framework are listed here.

• Microsoft's Shared Source Common Language Infrastructure is a shared source


implementation of the CLR component of the .NET Framework. It runs on
Microsoft Windows XP, FreeBSD, and Mac OS X 10.2.
• Portable.NET (part of DotGNU) provides an implementation of the Common
Language Infrastructure (CLI), portions of the .NET Base Class Library (BCL),
and a C# compiler. It supports a variety of CPUs and operating systems.
• Mono is an implementation of the CLI and portions of the .NET Base Class
Library (BCL), and provides additional functionality. It is dual-licensed under
free software and proprietary software licenses. Mono is being developed by
Novell, Inc. It includes support for ASP.NET, ADO.NET, and evolving support
for Windows Forms libraries. It also includes a C# compiler, and a VB.NET
compiler is in pre-beta form.

Base Class Library


TThe Base Class Library (BCL) is a library of types and functionalities available to all
languages using the .NET Framework. In order to make the programmer's job easier,
.NET includes the BCL in order to encapsulate a large number of common functions,

30 Cont…
such as file reading and writing, graphic rendering, database interaction, and XML
document manipulation. It is much larger in scope than standard libraries for most
other languages, including C++, and would be comparable in scope to the standard
libraries of Java. The BCL is sometimes incorrectly referred to as the Framework
Class Library (FCL), which is a superset including the Microsoft.* namespaces.

The BCL is updated with each version of the .NET Framework.

Namespaces

Some of these namespaces may or may not be officially considered part of the BCL by
Microsoft, but all are included as part of the standard libraries that are provided with
the .NET Framework.

System
This namespace includes the core needs for programming. It includes base types
like String, DateTime, Boolean, and so forth, support for environments such as
the console, math functions, and base classes for attributes, exceptions, and
arrays.

System.CodeDom
This library provides the ability to create code and run it, at runtime.

System.Collections
Defines many common containers or collections used in programming, such as
lists, queues, stacks, hashtables, and dictionaries. It includes support for
generics.

31 Cont…
System.ComponentModel
Provides the ability to implement the run-time and design-time behavior of
components and controls. It contains the infrastructure "for implementing
attributes and type converters, binding to data sources, and licensing
components."

System.Configuration
Provides the infrastructure for handling configuration data.

System.Data
This namespace represents the ADO.NET architecture, which is set of computer
software components that can be used by programmers to access data and data
services.

System.Deployment
Allows you to customize the way your application upgrades when using
ClickOnce.

System.Diagnostics
Gives you the ability to diagnose your application. It includes event logging,
performance counters, tracing, and interaction with system processes.

System.DirectoryServices
Provides easy access to Active Directory from managed code.
System.Drawing
Provides access to GDI+ graphics functionality, including support for 2D and
vector graphics, imaging, printing, and text services.
System.EnterpriseServices
"Provides .NET objects with access to COM+ services making the .NET
Framework objects more practical for enterprise applications."

32 Cont…
System.Globalization
Provides help for writing internationalized applications. "Culture-related
information, including the language, the country/region, the calendars in use,
[and] the format patterns for dates, currency, and numbers" can be defined.

System.IO
Allows you to read from and write to different streams, such as files or other
data streams. Also provides a connection to the file system.

System.Management
Allows you to query for information, "such as how much free space is left on
the disk, what is the current CPU utilization, which database a certain
application is connected to, and much more."

System.Media
Provides you the ability to play system sounds and .wav files.

System.Messaging
Allows "you to connect to, monitor, and administer message queues on the
network and send, receive, or peek messages." .NET Remoting is another name
for some of the functionality provided. This namespace is being superseded by
Windows Communication Foundation.

System.Net
Provides an interface "for many of the protocols used on networks today," such
as HTTP, FTP, and SMTP. Secure communication is supported by protocols
such as SSL.

System.Reflection
Provides an object view of types, methods, and fields. You have "the ability to
dynamically create and invoke types."

33 Cont…
System.Resources
Allows you to manage many different resources in the application in order to
internationalize an application for different cultures and languages.

System.Runtime
Allows you to manage the runtime behavior of an application or the CLR. Some
of the included abilities are interoping with COM or other native code, writing
distributed applications, and serializing objects into binary or SOAP.

System.Security
"Provides the underlying structure of the common language runtime security
system." This namespace allows you to build security into your application
based on policy and permissions. It provides services such as cryptography.

System.ServiceProcess
Allows you to create applications that run as a service within Windows.

System.Text
Supports various encodings, regular expressions, and a more efficient
mechanism for manipulating strings (StringBuilder).

System.Threading
Helps facilitate multithreaded programming. It allows the synchronizing of
"thread activities and access to data" and provides "a pool of system-supplied
threads."

System.Timers
"Allows you to raise an event on a specified interval."

System.Transactions
Provides support for local or distributed transactions.

34 Cont…
System.Web
Provides various web related functionality. It enables browser-server
communication and the creating XML Web Services. Most or all of these
libraries are referred to as the ASP.NET architecture.

System.Windows.Forms
This namespace contains the Windows Forms architecture which provides
access to the older Windows API for writing graphical applications for Windows
from within managed code. This system is being superseded by the Windows
Presentation Foundation.

System.Xml
"Provides standards-based support for processing XML," including reading,
writing, schemas, serialization, searching, and transforming

.NET Languages

35 Cont…
.NET Languages are computer programming languages that are used to produce
programs that execute within the Microsoft .NET Framework. Microsoft provides
several such languages, including C#, Visual Basic .NET, and C++/CLI.

Regardless of which .NET language is used, the output of the language compiler is a
representation of the same logic in an intermediate language named Common
Intermediate Language. Before the program is executed, CIL is compiled to object
code appropriate for the machine on which the program is executing. This last
compilation step is usually performed by the Common Language Runtime component
of the framework at the moment the program is invoked, though it can be manually
performed at an earlier stage.

While there are currently over 40 languages with compilers for the .NET Framework,
only a small number of them are widely used and supported by Microsoft. The
remainder is composed of languages developed by third party vendors.

Microsoft .NET languages

• C# - Microsoft's flagship .NET Framework language which bears similarities to


the C++ and Java languages.
• Visual Basic .NET - A completely redesigned version of the Visual Basic
language for the .NET Framework. This also includes Visual Basic 2005 (v8.0).
• C++/CLI and the deprecated Managed C++ - A managed version of the C++
language.
• J# - A Java and J++ .NET transitional language.
• JScript .NET - A compiled version of the JScript language.
• Windows PowerShell - An interactive command line shell/scripting
environment which provides full access to the .NET frameworks.
• IronPython - A .NET implementation of the Python programming language
developed by Jim Hugunin at Microsoft.
• F#, a member of the ML programming language family.

36 Cont…
ADO.NET

ADO.NET is a set of computer software components that can be used by


programmers to access data and data services. It is a part of the base class library that
is included with the Microsoft .NET Framework. It is commonly used by programmers
to access and modify data stored in relational database systems, though it can also be
used to access data in non-relational sources. ADO.NET is sometimes considered an
evolution of ActiveX Data Objects (ADO) technology, but was changed so extensively
that it can be perceived as an entirely new product

ASP.NET

ASP.NET is a set of web application development technologies marketed by


Microsoft. Programmers can use it to build dynamic web sites, web applications and
XML web services. It is part of Microsoft's .NET platform and is the successor to
Microsoft's Active Server Pages (ASP) technology.

ASP.NET is built on the Common Language Runtime, meaning programmers can


write ASP.NET code using any Microsoft .NET language.

ASPX file format

37 Cont…
ASPX is a text file format used to create Webform pages; in programming jargon, the
ASPX file typically contains static HTML or XHTML markup, as well as markup
defining Web Controls and Web User Controls where the developer places all the
required static and dynamic content for the web page. Additionally, dynamic code
which runs on the server can be placed in a page within a block <% -- dynamic code
-- %> which is similar to other web development technologies such as PHP, JSP, and
ASP, but this practice is generally discouraged except for Databinding.

The recommended method for dealing with dynamic program code is to use the code-
behind model, which places this code in a separate file or in a specially designated
script tag. Code-behind files are typically named something to the effect of
MyPage.aspx.cs or MyPage.aspx.vb based on the ASPX file name (this practice is
automatic in Microsoft Visual Studio and other IDEs). When using this style of
programming, the developer writes code to respond to different events, like the page
being loaded, or a control being clicked, rather than a procedural walk through the
document.

Other files
Other file extensions associated with different versions of ASP.NET include:

• asax - Global.asax, used for application-level logic and event handling


• ascx - Web UserControls: custom controls to be placed onto web pages.
• ashx - custom HTTP handlers
• asmx - web service pages.
• axd - when enabled in web.config requesting trace.axd outputs application-level
tracing.
• browser - browser capabilities files stored in XML format; introduced in
version 3.0. ASP.NET 2 includes many of these by default, to support common
web browsers. These specify which browsers have which capabilities, so that
ASP.NET 2 can automatically customize and optimize its output accordingly.
Special .browser files are available for free download to handle, for instance, the
W3C Validator, so that it properly shows standards-compliant pages as being
standards-compliant. Replaces the harder-to-use BrowserCaps section that was
in machine.config and could be overridden in web.config in ASP.NET 1.x.

38 Cont…
• config - web.config is the only file in a specific Web application to use this
extension by default (machine.config similarly affects the entire Web server and
all applications on it), however ASP.NET provides facilities to create and
consume other config files. These are stored in XML format, so as to allow
configuration changes to be made with simplicity.
• cs/vb - In ASP.NET 2 any cs/vb files placed inside the App_Code folder are
dynamically compiled and available to the whole application.
• master - Master Pages; introduced in version 2.0
• sitemap - sitemap configuration files
• skin - theme skin files

Performance

ASP.NET aims for performance benefits over other script-based technologies


( including ASP Classic ) by compiling the server-side code to one or a few DLL files
on the web server. This happens transparently in the background the first time a page is
requested (i.e., the developer need not perform a separate compilation step for pages).
This provides the ease of development offered by scripting languages with the
performance benefits of a compiled binary.

The ASPX and other resource files are placed in a virtual host on an Internet
Information Services ( or other compatible ASP.NET servers; see Other
Implementations, below ). The first time a client requests a page, the .NET
framework parses and compiles the file(s) into a .NET assembly and sends the
response; subsequent requests are served from the dll files.

Developers can also choose to pre-compile their code before deployment, eliminating
the need for just-in-time compilation in a production environment.

39 Cont…
Biliography:
Search engine:
Yahoo
Google
Altavista

40 Cont…

Potrebbero piacerti anche