The Internet Encyclopedia (Volume 3)

(coco) #1

P1: IML


Owen WL040/Bidgolio-Vol I WL040-Sample.cls June 20, 2003 17:37 Char Count= 0


618 VISUALBASIC

originally written in, execute through the common lan-
guage Runtime (CLR). The base class library is a library
of object classes that are available to all .NET languages.
Current literature disagrees on whether the base class li-
brary is a separate element of the framework or part of
the CLR (Aitken & Syme, 2002; Evjen & Beres, 2002).
Some of the base class library deals with non-Internet-
related issues. Windows NT event log manipulation is one
example. Others classes are specific to Internet program-
ming and Web Services development. An application writ-
ten in a .NET language is compiled into an “intermediate
language” (IL). All .NET applications compile to this com-
mon IL, regardless of what language is used to create the
program. Developers never deal directly with the IL ver-
sion of the program; IL is the output of an intermediate
compilation step. Therefore, the actual makeup of the IL
is not important to a basic understanding of .NET. It is
sufficient to know that IL is optimized for quick compila-
tion into machine-specific code. When a Web server calls
the .NET application, the IL code is passed to the com-
mon language Runtime, which compiles the IL code to
machine-specific code and executes the program. Each
module is compiled on an as-needed basis. Modules that
are not called during execution are not compiled. Com-
piled functions are cached for future reference (Aitken &
Syme, 2002; Evjen & Beres, 2002).
This dual compilation mechanism (source code to IL
and IL to CLR) seems complex and would appear to
slow execution, but it actually has several advantages.
Since only executed modules are compiled, less memory is
needed at runtime. The CLR is the only machine-specific
portion of the .NET framework. Porting the framework to
another computing platform requires only that the CLR be
changed. Applications require no changes. At runtime, the
CLR translates the IL code into platform-specific machine
language. Any hardware platform that supports the .NET
framework can run applications developed on any plat-
form within the framework. The base class library stan-
dardizes the set of object classes between all applications
and hardware platforms.

Assemblies
.NET applications are deployed in assemblies. An assem-
bly is a combination of IL code, machine language code,
and a manifest (Evjen & Beres, 2002). The manifest con-
tains the name of the assembly, version, information on
all object classes used, and other data the CLR needs to
run the application (Aitken & Syme, 2002). The manifest
is metadata, information about an entity that is contained
in the entity itself. The use of metadata eliminates the need
to use the system registry to associate DLL files with an
application. To deploy a .NET application, simply copy
the assembly into the appropriate folder. Since all the in-
formation needed to execute the assembly is contained in
the assembly, any calling routine need only be able to find
the assembly to execute it. Complex installations requir-
ing changes to the system registry are a thing of the past
with .NET.

Namespaces
A namespace is a repository, or container, for a set of ob-
ject classes. Using namespaces allows two object classes of

the same name to coexist simultaneously, each in its own
namespace (Aitken & Syme, 2002). This concept roughly
equates to the scope property of variables. Two variables
of the same name may exist in the same program provided
they are created in different procedures. Two classes of the
same name may exist in a single system if they are placed
in different namespaces. Namespaces allow programmers
to develop classes without regard to other classes in the
system. This facilitates the team approach to application
development and allows assemblies to be incorporated
into other programs without conflicts.

Visual Basic.NET
Visual Basic.NET and the .NET framework offer signifi-
cantly enhanced tools to speed application development.
Visual Basic.NET language innovations, RAD features,
new forms models for Web-based applications, and new
forms models for Windows-based applications create a
powerful application development environment. These
enhancements have resulted in some significant changes
between Visual Basic.NET and previous versions of Visual
Basic.

Language Innovations
Visual Basic.NET is now a fully object-oriented language.
Previous versions of Visual Basic did not fully implement
all aspects of objects, specifically with respect to inheri-
tance. Visual Basic.NET fully supports inheritance, poly-
morphism, encapsulation, overloading, and overriding
(Lhotka, 2002). Visual Basic.NET incorporates an object-
based exception handling system that provides a consis-
tent means of dealing with errors. Errors involving meth-
ods, multiple method chains, and external components
including those created in other .NET languages are all
handled through the same error object, eliminating sepa-
rate error handlers for each source.

RAD Features
Visual Basic.NET includes most of the features that make
Version 6.0 a RAD environment. With .NET, these RAD
tools can be applied to client- and server-based application
development. The Visual Basic.NET integrated design en-
vironment (IDE) is similar to Visual Basic 6.0. Developers
already familiar with other versions of Visual Basic or Vi-
sual InterDev can quickly transition to Visual Basic.NET.

Web Forms
The inclusion of Web forms allows development of Web-
based applications in the familiar Visual Basic environ-
ment. Developers do not need to learn a different IDE.
All tools and features available for traditional Windows-
based application design are available for Web-based ap-
plications design.

Web Services
Creating Web Services in Visual Basic.NET is as simple
as adding the <webmethod> identifier to a method. The
underlying code that enables the Web Service is created
and managed by Visual Basic.NET’s IDE and .NET’s un-
derlying framework.
Free download pdf