![]() |
![]() |
![]() |
![]() |
||
|
![]() |
|||||||||
|
|
|||||||||||||||||||||
|
.NET Framework
The .NET Framework (pronounced, “dot net”) is just one part of Microsoft’s .NET
technology. The purpose of the .NET Framework is to create and run
next-generation applications and XML Web services. Some of its main
characteristics include the following:
Class Libraries
The Microsoft .NET Framework class library is an object-oriented collection of
reusable and extendable types (classes, interfaces, structures, and enumerated
types). These types provide access to system functionality such as
input/output, data manipulation, windows and other GUI elements, security,
network communications, and creating web-based or windows-based applications.
The types of the .NET class library are grouped hierarchically in namespaces to
facilitate their use. For example, types for implementing GUI elements such as
TextBoxes, Buttons, and many more can be accessed by using the
System.Windows.Forms namespace.
With the .NET class library, developers can write managed code in any .NET
programming language (such as C#, VB.NET, or J#) to build component-based
applications, components, or controls, using the types as-is or extending them.
Managed code is code that provides information to the common language runtime,
which consequently provides services such as memory management and object
management, cross-language portability, and code execution security to the
managed code.
Being fully object-oriented, the classes in the .NET Framework class library
are derived from base classes higher up in the Framework’s hierarchy,
inheriting their characteristics. Unlike in previous frameworks, classes in the
.NET Framework can be interoperable, meaning that a C# class could inherit from
a VB.NET class, allowing developers from different backgrounds to work
seamlessly together. Developers can therefore use the programming language of
their choice (such as C# or VB.NET, or any one of roughly 20 others), or the
one that is most suitable for the task, even within the same application.
Developers can write classes derived from the classes of the .NET Framework to
create third-party .NET class libraries. These libraries are similar to the
.NET Framework class library in many respects. However, they are designed with
the following goals in mind:
Components
A software component is a reusable object that performs a set of related
functions and interacts with other components or applications. It is the
logical isolation or encapsulation of a given type of functionality.
.NET components have additional characteristics. First, they control external
resources explicitly (for example, memory), giving developers precise control.
Second, they feature design-time support. This means that they can be used in a
rapid application development environment, where, for example, developers can
drag and drop components easily onto the Form of the application they are
developing, and modify its characteristics. Most components allow their
characteristics to be modified by changing values in the Properties tab of
Visual Studio .NET, but more sophisticated components have more advanced
WYSIWYG capabillities, such as allowing developers to change details directly
on a Form, and even contextualized assistants.
A .NET component is built up from the types in the hierarchy of the .NET
Framework class library. In other words, a component will have inherited many
of its characteristics from classes higher up in the hierarchy of types, but
will have been extended and/or specialized by the component’s author. Because a
component may expose some or all of the details of its classes (data members
and methods, etc.), a developer can further specialize it in order to extend
its capabilities.
Another advantage to using components is that developers can add a
functionality to their code without writing the code themselves. For example,
rather than having to learn the intricacies of FTP and how to use this protocol
using the .NET Framework (which possesses no classes to accomplish this
directly), developers can simply “plug in” a component that offers the desired
functionality. This translates directly into savings in time-to-market. Yet
another advantage is that components are generally more stable, because they
are written and tested by specialists. Finally, component developers can
dedicate the resources necessary to produce code that is more intuitive and
flexible.
Examples of components include data compression, encryption, and networking
objects.
.NET control
A control is a visual component that is part of a user interface, such as a GUI
element like a button, a toolbar, or a text box. Although these GUI elements
can all be produced using the .NET Framework class library—and indeed this is
how third-party .NET controls are created—a third-party control offers
developers some advantages:
ActiveX
ActiveX is an older set of Microsoft technologies originally intended to allow
Web site developers to provide interactive content in their Web pages. However,
it was eventually used in Windows-based applications. It is not a programming
language, but rather a set of rules describing how applications can share
information.
Although ActiveX can be used in applications, it is limited to providing parts
of an application, such as user interface elements or a given functionality,
rather than an entire application. In other words, unlike the .NET Framework,
it is not an application framework. Developers using ActiveX components or
controls write the application in a given progamming language, such as C++ or
Visual Basic, and use the Win32 API, MFC, or WTL frameworks to access the rest
of the functionality necessary to create a program. Nevertheless, developers
are often constrained by the technology used in their workplace. Many controls
and components based on this technology are available.
ActiveX components and controls are generally COM objects. This means that they
can be used in a programming language other than the one used to create them.
However, ActiveX components and controls are compiled for a specific type of
processor and operating system, which limits their reusability. In fact almost
all of them are compiled for Intel (x86) processors. A major disadvantage of
ActiveX is its lack of security: ActiveX components and controls can directly
access a user’s hard drive, potentially wreaking havoc.
Components
Just as .NET components encapsulate a given functionality, so do ActiveX
components. However, this type of technology lacks the advantages of the .NET
Framework. For example, because they are not extensions of a common framework
or hierarchy of classes, a specialized component cannot be used in a context
where a non-specialized component is called for. Furthermore, because ActiveX
components do not expose all of the details of their class, programmers cannot
inherit from them or extend their capabilities. ActiveX components are specific
to CPUs and operating systems, limiting their usefulness to users without PCs
and Windows. However, because ActiveX components are COM objects, developers
can use them in a programming language other than the one used to create them.
For example, a component written in Visual Basic can be used in an application
being written in C++.
ActiveX Controls
ActiveX controls are visual components. Examples of ActiveX controls include
menus, toolbars, buttons, etc. As with ActiveX components, ActiveX controls are
limited because they do not belong to a common framework. Neverthelesse,
because ActiveX are COM objects, developers can use them in a programming
language other than the one used to create them. For example, a control written
in Visual Basic can be used in an application being written in C++.
Libraries
Unlike third-party .NET class libraries, ActiveX libraries do not “fit into” a
framework. Whereas a class in a .NET class library inherits from a class or
from classes in the .NET Framework, an ActiveX component or control does not.
What this can mean for developers is that they must write much more code to get
the functionality that would normally be inherited from higher classes, as is
the case with the .NET Framework.
|