44
•
Richer User Interface Web Forms are a giant step towards much richer web-based
user interfaces. Their built-in intelligence allows rich, browser-independent screens to
be developed quickly, and to be easily integrated with compiled code. Microsoft has
announced an initiative for the future called the Universal Canvas which builds upon
the XML standards to transform the internet from a Read only environment into a
read/write platform, enabling users to interactively create, browse, edit and analyze
information. The universal canvas can bring together multiple sources of information
anywhere in the world to enable seamless data access and use.(The universal canvas
will log on to the Ms System of servers whenever the new device is turned on)
Centrally controlled OS, Office and Visual Studio.
•
Easy Deployment Executable modules in .NET are self-describing. Once the
Common Language Runtime (CLR is explained in next sections) knows where a
module resides, it can find out everything else it needs to know to run the module,
such as the module’s object interface and security requirements, from the module
itself. That means a module can just be copied to a new environment and immediately
executed.
•
Support for Multiple Languages The CLR executes binary code called MSIL
(Microsoft intermediate language), and that code looks the same regardless of the
original source language. All .NET –enabled languages use the same data types and
the same interfacing conventions. This makes possible for all .NET language to
interoperate transparently. One language can call another easily, and languages can
even inherit classes written in another language and extend them current platform has
anywhere near this level of language interoperability.
•
Extendibility The completely object based approach of .NET is designed to allow
base functionality to be extended through inheritance ( unlike COM) and the
platform’s functionality is appropriately partitioned to allow various parts( such as the
just-in-time compilers discussed in the next section) to be replaced as new versions
are needed. It is likely that, in the future, new ways of interfacing to the outside world
will be added to the current trio of windows Form, Web Forms, and Web Services
such as universal Canvas.
•
Portability of compiled Applications .NET allows the future possibility of moving
software to other hardware and operating system platforms. The ultimate goal is that
compiled code produced on one implementation of .NET (such as Windows) could be
moved to another implementation of .NET on a different operating system merely by
copying the compiled code over and running it.
•
Integrity with COM .NET integrates very will with COM-based software. Any COM
component can be treated as a .NET component by other .NET components. The
.NET Framework wraps COM components and exposes an interface that .NET
37
components can work with. This is absolutely essential to the quick acceptance of
.NET, because it makes .NET interoperable with a tremendous amount of older
COM-based software.
Other benefits of using .NET architecture
•
The Microsoft .NET platform's reliance on XML for data exchange—an open
standard managed by the World Wide Web Consortium (W3C)—and modular XML
Web services removes barriers to data sharing and software integration.
•
The .NET platform, through the .NET Framework's common language runtime,
enables XML Web services to interoperate whatever their source language.
Developers can build reusable XML Web services instead of monolithic applications.
By making it easy to offer your XML Web services to others.
•
The ability to easily find available XML Web services means you can buy pieces of
your applications rather than build everything from scratch, focusing your time and
money where it makes the most sense.
•
Easier to build sophisticated development tools – debuggers and profilers can target
the Common Language Runtime, and thus become accessible to all .NET-enabled
languages.
•
Potentially better performance in system level code for memory management,
garbage collection, and the like have yielded an architecture that should meet or
exceed performance of typical COM-based applications today.
•
Fewer bugs, as whole classes of bugs should be unknown in .NET. With the CLR
handling memory management, garbage collection.
•
Faster development using development tool like visual studio.net
N-tier architecture with .NET
Applications developed in the .NET Framework will still, in, many cases, use a DNA
model to design the appropriate tiers. However, the tiers will be a lot easier to produce in
.NET. The presentation tier will benefit from the new interface technologies and
especially Web Forms for Internet development. The middle tier will require far less
COM-related headaches to develop and implement. And richer, more distributed middle
tier designs will be possible by using Web Services.
10
Let us look into how .Net fit into n – tier architecture. When you talk about a true
distributed n-tier type of application, you are talking about separating the components of
the different tiers on different machines as well as in separate components. Figure 1
shows a typical example of an n-tier application with multiple components on each
machine.
Figure 1. A distributed n-tier application has three physical tiers with one or more
logical tiers on each machine
There are many different ways you could configure an n-tier application. For example,
the business rules may go on a separate machine and you might use .NET Remoting to
talk from the client application to the business rule tier as shown in Figure 2.
29
We may also have a data input validation rule component on the client to check simple
rules such as required fields and formatting. These are rules that you do not want to make
a trip across the network just to check. You may then also add a business rule layer on the
same tier as the data layer component to check complicated business rules that compare
the data from one table to another.
These are just a few different configurations that you may utilize. Of course, you could
come up with something unique that fits your specific situation. Regardless of how you
structure the physical implementation of the components, make sure that the logical
structure of the program is broken up into components as shown in the above figures.
2.4 Understanding the .NET Platform and its layers
Here in this section we will be covering what the .NET Platform is made up of
and we will define its layers. To start, .NET is a framework that covers all the layers
of software development above the Operating System. It provides the richest level of
integration among presentation technologies, component technologies, and data
technologies ever seen on Microsoft, or perhaps any, platform. Secondly, the entire
architecture has been created to make it easy to develop Internet applications, as it
is to develop for the desktop.
Constituents of .NET Platform
The .NET consists of the following three main parts
•
.NET Framework – a completely re-engineered development environment.
•
.NET Products – applications from MS based on the .NET platform, including
Office and Visual Studio.
•
.NET Services – facilitates 3
rd
party developers to create services on the .NET
Platform.
24
.NET Platform Architecture
The above diagram gives you an overview of the .NET architecture. At the bottom of
the diagram is your Operating System above that sits the .NET framework that acts
as an interface to it. The .NET wraps the operating system, insulating software
developed with .NET from most operating system specifics such as file handling and
memory allocation.
The Common Language Runtime (CLR)
At the base is the CLR. It is considered as the heart of the .NET framework. .NET
applications are compiled to a common language known as Microsoft Intermediate
Language or “IL”. The CLR, then, handles the compiling the IL to machine language,
at which point the program is executed.
The CLR environment is also referred to as a managed environment, in which
common services, such as garbage collection and security, are automatically
provided.
More information on CLR is available at
http://msdn.microsoft.com/library/en-us/cpguide/html/cpconthecommonlanguageruntime.asp
The .NET Class Framework
Remote user
over
Remote systems
over
Intranet/Internet
Operating System
Windows 2000/NT/98/Me – Others in
52
The next layer up in the framework is called the .NET Class Framework also referred
as .NET base class library. The .NET Class Framework consists of several thousand
type definitions, where each type exposes some functionality. All in all, the CLR and
the .NET Class Framework allow developers to build the following kinds of
applications:
•
Web Services. Components that can be accessed over the Internet very easily.
•
Web Forms. HTML based applications (Web Sites).
•
Windows Forms. Rich Windows GUI applications. Windows form applications can
take advantage of controls, mouse and keyboard events and can talk directly to
the underlying OS.
•
Windows Console Applications. Compilers, utilities and tools are typically
implemented as console applications.
•
Windows Services. It is possible to build service applications controllable via the
Windows Service Control Manager (SCM) using the .NET Framework.
•
Component Library. .NET Framework allows you to build stand-alone components
(types) that may be easily incorporated into any of the above mentioned
application types.
ADO.NET: Data and XML
ADO.NET is the next generation of Microsoft ActiveX Data Object (ADO) technology.
ADO.NET is heavily dependent on XML for representation of data. It also provides an
improved support for the disconnected programming model.
ADO.NET’s DataSet object, is the core component of the disconnected architecture of
ADO.NET. The DataSet can also be populated with data from an XML source, whether
it is a file or an XML stream.
For more details on ADO.NET, check out
http://msdn.microsoft.com/library/en-us/cpguide/html/cpconaccessingdatawithadonet.asp
User Interface
The next layer consists of the user and programming interface that allows .NET to
interact with the outside world. The following are the types of interaction interfaces
that are supported by the .NET framework:
•
Web Forms
•
Windows Forms
•
Web Services
Now let me tell you about Windows Forms and ASP.NET. WinForms (Windows Forms)
is simply the name used to describe the creation of a standard Win32 kind of GUI
applications.
The Active Server Pages web development framework has undergone extensive
changes in ASP.NET. The programming language of choice is now full-blown VB.NET
or C# (or any supported .NET language for that matter). Other changes include:
•
New support for HTML Server Controls (session state supported on the server).
•
It is now possible for the server to process client-side events.
44
•
New control families including enhanced Intrinsics, Rich controls, List controls,
DataGrid control, Repeater control, Data list control, and validation controls.
•
New support for developing Web Services—application logic programmatically
accessible via the Internet that can be integrated into .NET applications using the
Simple Object Access Protocol (SOAP).
Languages
The CLR allows objects created in one language be treated as equal citizens by code
written in a completely different language. To make this possible, Microsoft has
defined a Common Language Specification (CLS) that details for compiler vendors
the minimum set of features that their compilers must support if they are to target
the runtime.
Any language that conforms to the CLS can run on the CLR. In the .NET framework,
Microsoft provides Visual Basic, Visual C++, Visual C#, and JScript support.
.NET Products
Microsoft Visual Studio .NET
Microsoft Visual Studio .NET represents the best development environment for the
.NET platform.
Integrations is the key in the new VS.NET IDE, thus a single IDE can be used to
program in a variety of managed languages from VB.NET to Visual C++ with
Managed extensions. Advance features in VS.NET truly propel development in to the
highest gear.
.NET Services:
XML Web Services
XML is turning the way we build and use software inside out. The Web revolutionized
how users talk to applications. XML is revolutionizing how applications talk to other
applications—or more broadly, how computers talk to other computers—by providing
a universal data format that lets data be easily adapted or transformed:
•
XML Web services allow applications to share data.
•
XML Web services are discrete units of code; each handles a limited set of tasks.
•
They are based on XML, the universal language of Internet data exchange, and
can be called across platforms and operating systems, regardless of
programming language.
•
.NET is a set of Microsoft software technologies for connecting your world of
information, people, systems, and devices through the use of XML Web services.
For more details refer:
http://msdn.microsoft.com/nhp/default.asp?contentid=28000442
.NET Runtime:
Let’s now discuss about the .NET Runtime.
41
Source File
Compilers
Binaries
Just-in-Time Compilation
Runtime
The .NET Framework provides a run-time environment called the Common Language
Runtime, which manages the execution of code and provides services that make the
development process easier. Compilers and tools expose the runtime's functionality
and enable you to write code that benefits from this managed execution
environment. Code developed with a language compiler that targets the runtime is
called managed code.
To enable the runtime to provide services to managed code, language compilers
must emit metadata, which the runtime uses to locate and load classes, lay out
instances in memory, resolve method invocations, generate native code, enforce
security, and set run-time context boundaries.
The runtime automatically handles objects, releasing them when they are no longer
being used. Objects whose lifetimes are managed in this way are called managed
data. Automatic memory management eliminates memory leaks as well as many
other common programming errors.
The CLR makes it easy to design components and applications whose objects interact
across languages. For example, you can define a class and then use a different
language to derive a class from your original class, or call a method on the original
class. You can also pass an instance of a class to a method on a class written in a
different language. This cross-language integration is possible because of the
common type system defined by the runtime, and they follow the runtime's rules for
defining new types, as well as for creating, using, persisting, and binding to types.
Language compilers and tools expose the runtime's functionality in ways that are
intended to be useful and intuitive to their developers. This means that some
features of the runtime might be more noticeable in one environment than in
another. How you experience the runtime depends on which language compilers or
tools you use. The following benefits of the runtime might be particularly interesting
to you:
•
Performance improvements.
•
The ability to easily use components developed in other languages.
•
Extensible types provided by a class library.
•
A broad set of language features.
++
28
2.5 Understanding the various components of the .NET Platform
and the functions performed by them
Now we will go in detail about the various components that build the .NET framework
and its functionalities.
Common Language Runtime
At the core of the .NET platform is the Common Language Runtime (CLR). The CLR
simplifies application development, provides a robust and secure execution
environment, supports multiple languages and simplifies application deployment and
management.
The diagram below provides more details on the CLR's features:
In this section we will cover some of the more significant features provided to .NET
applications by the CLR. These include:
•
Memory Management
•
Common Type System
Before moving further let us discuss briefly about Common Language
Infrastructure(CLI) according to Standardizing Information and Communication
Systems(ECMA) specifications.
The Microsoft Shared Source CLI Implementation is a
file archive containing working source code for the ECMA-334 (C#) and ECMA-335
(Common Language Infrastructure, or CLI) standards. In addition to the CLI
implementation and the C# compiler, the Shared Source CLI Implementation from
Microsoft called ROTOR contains tools, utilities, additional Framework classes, and
samples.
For the benefit of existing codebases, the CLI standard also takes pains to describe
in detail how unmanaged software can co-exist safely with managed components,
enabling seamless sharing of computing resources and responsibilities.
Documents you may be interested
Documents you may be interested