0% found this document useful (0 votes)
27 views

Unit 1 - Topic 1 VB - Net Framework, Architectre and Components

The document discusses the .NET framework, which is a software development platform developed by Microsoft for building Windows applications. It consists of developer tools, programming languages, and libraries. The .NET framework allows building desktop and web applications, websites, web services, and games. It supports over 60 programming languages, including 11 designed by Microsoft like C# and VB.NET. The framework includes a common language runtime, common type system, common language specification, and framework class library.

Uploaded by

Vandana Dulani
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views

Unit 1 - Topic 1 VB - Net Framework, Architectre and Components

The document discusses the .NET framework, which is a software development platform developed by Microsoft for building Windows applications. It consists of developer tools, programming languages, and libraries. The .NET framework allows building desktop and web applications, websites, web services, and games. It supports over 60 programming languages, including 11 designed by Microsoft like C# and VB.NET. The framework includes a common language runtime, common type system, common language specification, and framework class library.

Uploaded by

Vandana Dulani
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

VB.

NET Framework
What is .Net Framework?
.Net Framework is a software development platform developed by
Microsoft for building and running Windows applications. The .Net
framework consists of developer tools, programming languages, and
libraries to build desktop and web applications. It is also used to build
websites, web services, and games.
The .Net framework was meant to create applications, which would run
on the Windows Platform. The first version of the .Net framework was
released in the year 2002. The version was called .Net framework 1.0.
The Microsoft .Net framework has come a long way since then, and the
current version is .Net Framework 4.7.2.

The Microsoft .Net framework can be used to create both – Form-


based and Web-based applications.

.NET Framework supports more than 60 programming languages in


which 11 programming languages are designed and developed by
Microsoft. The remaining Non-Microsoft Languages which are supported
by .NET Framework but not designed and developed by Microsoft.

11 Programming Languages which are designed and developed by


Microsoft are:

 C#.NET
 VB.NET
 C++.NET
 J#.NET
 F#.NET
 JSCRIPT.NET
 WINDOWS POWERSHELL
 IRON RUBY
 IRON PYTHON
 C OMEGA
 ASML(Abstract State Machine Language)
.Net Framework Architecture
.Net Framework Architecture is a programming model for the .Net
platform that provides an execution environment and integration with
various programming languages for simple development and
deployment of various Windows and desktop applications. It consists of
class libraries and reusable components.

The basic architecture of the .Net framework is as shown below.

.Net Framework Architecture and its components:


COMPONENTS OF .NET FRAMEWORK
The architecture of .Net framework is based on the following key
components;

1. Common Language Runtime (CLR)


2. Common Type System (CTS)
3. Common Language Specification (CLS)
4. Framework Class Library (FCL)
5. Base Class Library (BCL)

1. Common Language Runtime (CLR)


.NET CLR is a runtime environment that manages and executes the code
written in any .NET programming language. CLR is the virtual machine
component of the .NET framework. That language's compiler compiles the
source code of applications developed using .NET compliant languages
into CLR's intermediate language called MSIL, i.e., Microsoft intermediate
language code. This code is platform-independent. It is comparable to byte
code in java. Metadata is also generated during compilation and MSIL code
and stored in a file known as the Manifest file. This metadata is generally
about members and types required by CLR to execute MSIL code. A just-
in-time compiler component of CLR converts MSIL code into native code of
the machine. This code is platform-dependent. CLR manages memory,
threads, exceptions, code execution, code safety, verification, and
compilation.

The following figure shows the conversion of source code into native
code.

The above figure converts code into native code, which the CPU can
execute.
The main components of CLR are:
o Common type system
o Common language speciation
o Garbage Collector
o Just in Time Compiler
o Metadata and Assemblies

1. Common type system:


CTS provides guidelines for declaring, using, and managing data types at
runtime. It offers cross-language communication. For example, VB.NET
has an integer data type, and C# has an int data type for managing
integers. After compilation, Int32 is used by both data types. So, CTS
provides the data types using managed code. A common type system
helps in writing language-independent code.

It provides two categories of Types.

1. Value Type
2. Reference Type

2. Common Language Specification (CLS):


Common Language Specification (CLS) contains a set of rules to be
followed by all NET-supported languages. The common rules make it easy
to implement language integration and help in cross-language inheritance
and debugging. Each language supported by NET Framework has its own
syntax rules. But CLS ensures interoperability among applications
developed using NET languages.

3. Garbage Collection:
Garbage Collector is a component of CLR that works as an automatic
memory manager. It helps manage memory by automatically allocating
memory according to the requirement. It allocates heap memory to objects.
When objects are not in use, it reclaims the memory allocated to them for
future use. It also ensures the safety of objects by not allowing one object
to use the content of another object.

4. Just in Time (JIT) Compiler:


JIT Compiler is an important component of CLR. It converts the MSIL code
into native code (i.e., machine-specific code). The source code is compiled
into Microsoft Intermediate Language (MSIL) during the first compilation
process. The MSIL code is converted into native code in the second
compilation process. This process is called JIT compilation. JIT Compiler
compiles only those parts of MSIL code required during execution and
removes those parts that are not required .

5. Metadata:
A Metadata is a binary information about the program, either stored in a
CLR Portable Executable file (PE) along with MSIL code or in the memory.
During the execution of MSIL, metadata is also loaded into memory for
proper interpretation of classes and related. Information used in code. So,
metadata helps implement code in a language-neutral manner or achieve
language interoperability.

6. Assemblies:
An assembly is a fundamental unit of physical code grouping. It consists of
the assembly manifest, metadata, MSIL code, and a set of resources like
image files. It is also considered a basic deployment unit, version control,
reuse, security permissions, etc.
.NET CLR Functions
Following are the functions of the CLR.

o It converts the program into native code.


o Handles Exceptions
o Provides type-safety
o Memory management
o Provides security
o Improved performance
o Language independent
o Platform independent
o Garbage collection
o Provides language features such as
inheritance, interfaces, and overloading for
object-oriented programs.
.NET CLR Structure
Following is the component structure of Common
Language Runtime.

 Base Class Library Support

It is a class library that supports classes for the .NET


application.

 Thread Support

It manages the parallel execution of the multi-threaded


application.

 COM Marshaler

It provides communication between the COM objects and the


application.
 Security Engine

It enforces security restrictions.

 Debug Engine

It allows you to debug different kinds of applications.

 Type Checker

It checks the types used in the application and verifies that


they match the standards provided by the CLR.

 Code Manager

It manages code at execution runtime.

 Garbage Collector

It releases the unused memory and allocates it to a new


application.

 Exception Handler

It handles the exception at runtime to avoid application


failure.

 ClassLoader

It is used to load all classes at run time.


2. Common Type System (CTS)
The common type system defines how types are declared, used, and
managed in the common language runtime, and is also an important part
of the runtime's support for cross-language integration. The common
type system performs the following functions:

 Establishes a framework that helps enable cross-language


integration, type safety, and high-performance code execution.
 Provides an object-oriented model that supports the complete
implementation of many programming languages.
 Defines rules that languages must follow, which helps ensure that
objects written in different languages can interact with each other.
 Provides a library that contains the primitive data types (such
as Boolean, Byte, Char, Int32, and UInt64) used in application
development.

The CTS defines the following types:


1. Reference type: Reference types are allocated on the heap and
stores a reference to the value’s memory address.
2. Value type: Value types are allocated on the stack and directly
contain their data.
For example, C# has an int data type and VB.NET has Integer data
type. Hence a variable declared as an int in C# and Integer in VB.NET,
finally after compilation, uses the same structure Int32 from CTS.
3. Common Language Specification (CLS)
 The Common Language Specification (CLS) is a fundamental set of
language features supported by the Common Language Runtime
(CLR) of the .NET Framework. CLS is a part of the specifications of
the .NET Framework. CLS was designed to support language
constructs commonly used by developers and to produce verifiable
code, which allows all CLS-compliant languages to ensure the type
safety of code. CLS includes features common to many object-
oriented programming languages. It forms a subset of the
functionality of common type system (CTS) and has more rules
than defined in CTS.

 CLS (Common Language Specification) is a part of CLR in the


.NET Framework. The .NET Framework supports many
programming languages such as C#, VB.NET, J#, F#, etc. Every
programming language has its own syntactical rules for writing the
code which is known as a language specification. One
programming language’s syntactical rules (language specification)
cannot be understood by other programming languages. But, there
can be situations where we need to communicate between two
different programming languages. In order to ensure smooth
communication between different .NET Supported Programming
Languages, the most important thing is that they should have
Common Language Specifications which ensures that language
specifications defined in two different languages get compiled into a
Common Language Specification.

 CLR in .NET Framework will execute all programming language’s


code. This is possible because CLR has its own language
specification (syntactical rules) which are common to all .NET
Supported Programming Languages. At the time of compilation,
every language compiler should follow this language specification
of CLR and generate the MSIL code. This language specification of
CLR is common for all programming languages and this is known
as Common Language Specifications (CLS).
4. Framework Class Library (FCL)
The Framework class library (FCL) is a comprehensive collection of
reusable types including classes, interfaces and data types included in
the .NET Framework to provide access to system functionality.
Framework Class Library is a collection of classes, interfaces,
namespace, data, and value types that are used for .Net applications. It
is a superset of the base class library. It consists of in-built classes that
support base and user-defined data types, input/output and streaming
operations, web-client, server, and Windows based GUI applications
creation and underlying communication systems.
The functionality of FCL can be broadly classified into three
categories.
o Utility Features,
o Wrapper Around OS functionality, and
o Frameworks

It contains thousands of classes that supports the


following functions.

o Base and user-defined data types


o Support for exceptions handling
o input/output and stream operations
o Communications with the underlying system
o Access to data
o Ability to create Windows-based GUI applications
o Ability to create web-client and server applications
o Support for creating web services

In short, developers just need to import the BCL in their language code
and use its predefined methods and properties to implement common
and complex functions like reading and writing to file, graphic rendering,
database interaction, and XML document manipulation.
5. Base Class Library
The base class library encapsulates a large number of common
functions which can be used by the developers. They are the
foundational types and act as the base for all the .NET class
libraries. App-specific libraries will be built on top of BCL.
They are developed with general implementations with a high-
performance policy such as low-latency, high throughput, low-
memory, and low-CPU usage. Features such as ADO.Net, XML
handling, Threading, Security, Diagnosis, etc., are part of the
base class library.
BCL is a subset of Framework Class Library. It typically
includes classes in namespaces like:
o System
o System.Data
o System.Diagnostics
o System.Resources
o System.Globalization
o System.Text

You might also like