0% found this document useful (0 votes)
28 views12 pages

Unit - 1

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views12 pages

Unit - 1

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

SDJ International College, Palsana

Unit - 1 Overview of Microsoft .NET Framework


1.1 The .NET Framework

The .NET Framework is a software development platform that was introduced by


Microsoft in the late 1990 under the NGWS (NEXT GENERATION WEB
SERVICES) the first beta version released in 2000. It 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.

 .Net framework provides the new support for software development and
operating system in windows. The .Net framework wraps the operating
system with its own code.
 In a VB.Net application, program code is compiled into the CLR’s
(Common Language Runtime) Intermediate language (named MSIL or IL
for short).
 The CLR is the module that actually runs your VB.NET code.
 When you run the application, that IL code is translated into the binary code.
 The.NET frame work class library holds on immense amount of prewritten
code that all the applications you create with visual basic, visual C++, C#
and other languages.
 We can work on a machine that has the .NET frame work, and therefore the
CLR and the .NET framework class library, installed.
 .NET framework organizes its classes into namespaces.
 FCL provides user interface, database connectivity, cryptography, web
development and many more for Example services like mobile application.

Prof. Hemanta Bhatt Page 1


SDJ International College, Palsana

.Net Application

.NET Framework

Operating System + Hardware

The .Net Framework supports more than 60 programming languages such as C#,
F#, VB.NET, J#, VC++, JScript.NET, APL, COBOL, Perl, Oberon, ML, Pascal,
Eiffel, Smalltalk, Python, Cobra, ADA, etc.

The .NET Framework is composed of four main components:


1. Common Language Runtime (CLR)
2. Framework Class Library (FCL),
3. Core Languages (WinForms, ASP.NET, and ADO.NET)
4. Other Modules (WCF, WPF, WF, Card Space, LINQ, Entity Framework,
Parallel LINQ, Task Parallel Library, etc.)

Prof. Hemanta Bhatt Page 2


SDJ International College, Palsana

 CLR (Common Language Runtime):

 It is the heart of .NET framework. It is the engine that compiles and


run the application. It uses MSIL (Microsoft Intermediate Language)
format code which is language independent for execution.

 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.

 It is a program execution engine that loads and executes the program.


It converts the program into native code. It acts as an interface
between the framework and operating system. It does exception
handling, memory management, and garbage collection. Moreover, it
provides security, type-safety, interoperability, and portability.

Prof. Hemanta Bhatt Page 3


SDJ International College, Palsana

 Class Loader: As and when needed, it loads the classes into the
system memory.

 Code Manager: CLR takes care of code management upon program


execution and provides various services such as memory
management, thread management, security management and other
system services. The managed code targets CLR, so it can take
benefits of useful features such as cross-language integration, cross-
language exception handling, versioning, enhanced security,
deployment support, and debugging. CLR written mostly in
Microsoft's new language, C.

 Garbage Collection: The CLR provides the garbage collection


feature for managing the lifetime of an object. This process relieves a
programmer from the task of manual memory management by
deallocating the blocks of memory associated with objects that are no
longer being used. The objects whose lifetime is managed by the
garbage collection process are called managed data.

 MSIL to Native Compilers: When you compile a program developed


in a language that targets the CLR, the compiler translates the code
into an intermediate language. This language is CPU-independent.

Prof. Hemanta Bhatt Page 4


SDJ International College, Palsana

This means that the code can be executed on any platform that
supports the .NET CLR as it converts the MSIL code to Native code.

 Debugger: It performs the debugging at runtime. Security Engine: In


NET platform, security is achieved through the Code Access Security
(CAS) model. In this model, the CLR enforces restrictions on
managed code through the use of objects called 'permissions'. The
CLR allows the code to perform only those tasks for which it has
permission. In other words, the CAS model specifies what the code
can access instead of specifying who can access resources.

 Exception Manager: It handles all the runtime exceptions occurring


during the execution of an application.

 Type Checker: This feature ensures that objects are always accessed
in compatible ways. Therefore, the CLR will prohibit a code from
assigning a 10-bytes value to an object that occupies 8 bytes.

 Thread Support: Thread is a light weight process. Process is nothing


but the program which is in execution. Thread provides the
multithreading support to an application.

 COM Marshaller: It allows the communication between the


application and COM (Component Object Model) objects.

 Class library support: It provides BCL classes when application


needs at execution time.

Prof. Hemanta Bhatt Page 5


SDJ International College, Palsana

 Framework Class Library (FCL):

 It is a standard library that is a collection of thousands of classes and used


to build an application. The BCL (Base Class Library) is the core of the
FCL and provides basic functionalities.
 It is the second major entity of the .NET framework which is designed to
integrate with Common Language Runtime (CLR). It is also known as
Framework Class Library (FCL).
 It is the object oriented collection of reusable types. It is a library
available to all languages using .NET.
 It provide classes which encapsulate a number of common function,
including file reading & writing, graphic rendering, database interaction
and XML document manipulation.
 One of the most important features of the .NET framework class library
is that it can be used in consistent manner across multiple languages.
This means that you can use the same set of classes for performing a
specific task in VB as well as in VC++.
 The .NET framework class library comprises of namespaces, which are
contained within assemblies.

Prof. Hemanta Bhatt Page 6


SDJ International College, Palsana

 Namespaces:
 Namespaces help you to create logical groups of related classes and
interfaces that can be used by any language targeting the .NET
framework.
 Namespaces allow you to organize your classes so that they can be easily
accessed in other applications.
 Namespace can also be used to avoid any naming conflicts between
classes that have the same names. For example, you can use two classes
with the same name in an application provided they belong to different
namespaces.
 You can access the classes belonging to a namespace by simply
importing the namespace into an application. The .NET framework uses a
dot (.) as a delimiter between classes and namespaces.
 E.g. System.Console represents the Console class of the System
namespace.

Prof. Hemanta Bhatt Page 7


SDJ International College, Palsana

The following are the main areas covered by Class library:


1. Data Structures
2. IO management
3. Windows and Web Controls
4. Database access
5. Multithreading
6. Remoting
7. Reflections

 Win Forms:
 It is also known as Windows Forms. It is used to create the GUI
(Graphical User Interface) for windows desktop application.
 The idea of Win Form has been taken from Windows Foundation Classes
(WFC) which was used for Visual J++.
 It also provides integrated and unified way of developing GUI. It has a
rich variety of windows controls and user interface support. E.g. Text
Box, Button, Check Box, Containers etc.
 With Win Forms, we can make a single user interface and use it in
VC++, VB and C#.
 Using Visual Studio.NET, we can simply design the GUI by dragging the
controls on a form. And this is all made possible because Visual Studio
NET as it uses the "System.Winforms" namespace to draw the GUI.

 ADO.NET and XML:


It is also known as Data Access Layer. With the help of this layer we can
access relational databases. It work with XML and provide the Disconnected
Data Model. It is a part of BCL.
It consists of two parts:
1. Data Provider-Connection, Parameter, Data Adapter, Data Reader.
2. Data Set

 Web Forms & Web Services:


Web Forms: It provides a tool for web application. We can say that it is a
part of ASP.NET. It is the forms engine that provides browser-based user
interface. It consists of two parts:
1. Template: It contains HTML based layout information for all GUI
elements.
2. Component: It contains the logic behind the controls.

It provides a neat presentation layer and application logic layer separation.


Prof. Hemanta Bhatt Page 8
SDJ International College, Palsana

With ASP.NET, Microsoft has provided presentation-business layer


separation – by introducing the concept of Web Forms. ASP.NET Web
Forms provide an easy and powerful way to build dynamic WUI (Web User
Interface).

Web Services: Web Services are the applications that run on a Web Server
and communicate with other applications. It uses a series of XML (standard
used for storing, carrying and different requests. They are the small unit of
code which is design to handle limited exchanging data over the internet)
based communicating protocols that respond to of task. They are operating
system and programming languages independent. It connects people, system
and devices. One example could be flight schedules and ticket reservation
systems.

The protocols on which Web Services are built summarized below:

UDDI: Stands for Universal Discovery and Description Integration. It


allows Businesses to search for other Businesses, allowing them to search
for the services it needs, know about the services and contact them.

WSDL: Stands for Web Services Description Language. WSDL is an


XML document that describes a set of SOAP messages and how those
messages are exchanged.

SOAP: Stands for Simple Object Access Protocol. It's the communication
protocol for Web Services.

XML, HTTP and SMTP: Stands for Extensible Markup Language,


Hyper Text Transfer Protocol and Simple Message Transfer Protocol
respectively. UDDI, WSDL and SOAP rely on these protocols for
communication.

 Managed Code MSIL, Metadata and JIT Compilation-Automatic


Memory Management:

What is MSIL code?


The Microsoft Intermediate Language (MSIL), also known as the Common
Intermediate Language (CIL) is a set of instructions that are platform

Prof. Hemanta Bhatt Page 9


SDJ International College, Palsana

independent and are generated by the language specific compiler from the
source code.

 A .NET programming language (C#, VB.NET, J# etc.) does not


compile into executable code; instead it compiles into an
intermediate code called Microsoft Intermediate Language
(MSIL).

 As a programmer one need not worry about the syntax of MSIL –


since our source code in automatically converted to MSIL.

 The MSIL code is then send to the CLR (Common Language


Runtime) that converts the code to machine language which is then
run on the host machine.

 MSIL is similar to Java Byte code. A Java program is compiled


into Java Byte code (the .class file) by a Java compiler, the class
file is then sent to JVM which converts it into the host machine
language.

 During the compile time, the compiler converts the source code
into Microsoft Intermediate Language (MSIL).

 Microsoft Intermediate Language (MSIL) is a CPU-independent


set of instructions that can be efficiently converted to the native
code. During the runtime the Common Language Runtime (CLR)'s
Just In Time (JIT) compiler converts the Microsoft Intermediate
Language (MSIL) code into native code to the Operating System.

 When a compiler produces Microsoft Intermediate Language


(MSIL), it also produces Metadata. The Microsoft Intermediate
Language (MSIL) and Metadata are contained in a portable
executable (PE) file.

 Microsoft Intermediate Language (MSIL) includes instructions for


loading, storing, initializing, and calling methods on objects, as
well as instructions for arithmetic and logical operations, control
flow, direct memory access, exception handling, and other
operations.

Prof. Hemanta Bhatt Page 10


SDJ International College, Palsana

Metadata: Metadata means data about the data. In NET, metadata is the
declarative information which is produced at compile time. It includes all
.NET files and assembly. It allows loading and locating code, enforcing code
security, generating native code, and providing reflection at runtime. In data
processing, metadata is definitional data that provides information about or
documentation of other data managed within an application or environment.

 Difference between Metadata and Manifest:


"Metadata is data about data and Manifest is data about assembly!!“
Manifest Maintains the information about the assemblies like version, name
local and an optional strong name that uniquely identifying the assembly.
This manifest information is used by the CLR. The manifest also contains
the security demands to verify this assembly. It also contains the names and
hashes of all the files that make up the assembly. The .NET assembly
manifest contains a cryptographic hash of different modules in the assembly.
And when the assembly is loaded, the CLR recalculates the hash of the
modules at hand, and compares it with the embedded hash. If the hash
generated at runtime is different from that found in the manifest, .NET
refuses to load the assembly and throws an exception. Metadata means Data
about the data. metadata yields the types available in that assembly, viz.
classes, interfaces, enums, structs, etc., and their containing namespaces, the
name of each type, its visibility/scope, its base class, the interfaces it
implemented, its methods and their scope, and each method’s parameters,
type’s properties, and so on. The assembly metadata is generated by the
high-level compilers automatically from the source files. The compiler
embeds the metadata in the target output file, a dll, an .exe or a .net module
in the case of multi-module assembly.

 Common Type System (CTS):


 It is a language integration, type safety, and high performance code
execution.
 It describes how types are declared, used and managed. It facilitates
cross-specification that defines the rules to support language
integration.
 This is done in such a way, that programs written in any language
(.NET compliant) can interoperate with one another.
 This also can take full advantage of inheritance, polymorphism,
exceptions, and other features. It makes sure that all .NET
applications use the same data types.

Prof. Hemanta Bhatt Page 11


SDJ International College, Palsana

 Common Language Specification (CLS):


CLS stands for Common Language Specification and it is a subset of CTS. It
defines a set of rules and restrictions that every language must follow which
runs under the .NET framework. The languages which follow these set of
rules are said to be CLS Compliant. In simple words, CLS enables cross-
language integration or Interoperability.

 Important Questions:
1. What is CTS?
2. Explain components of .NET Framework.
3. Discuss MSIL.
4. Define Namespace.
5. Explain CLR and Class Library in detail.
6. Explain .NET framework in detail.
7. What is garbage collection?
8. What is FCL?
9. Expalin CLR, CTS and FCL in detail.

Prof. Hemanta Bhatt Page 12

You might also like