Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 14

UNIT – 1

Introduction to the .NET framework:

Overview of .net framework,


Managed Execution process,
CLR,
.Net Framework class library,
common language specification,
Common Type System,
JIT Compilation,
MSIL,
Assemblies,
metadata,
Garbage collection.

Windows form:
Working with Visual Studio IDE,
creating a .NET solution,
MDI application.
Q1. What is garbage collection? Mca2022 2no.
Q2. Define cross language?
Q1. Explain CTS with example.
Q2. Write the steps for creation of MDI application.
Q1. Write and explain the steps of managed execution process of .NET program.

Q1. What are the important components of .Net? mca2021


Q2. Define CLR.
Q3. Define MSIL.
Q4. What is uses of Garbage Collector?
Q5. What do you mean by CTS.
Q1. What are the main components of .NET Framework?
Q2. What is Microsoft Intermediate Language(MSIL)?
Q3. What is the role of the JIT compiler in .NET Framework?
Q1.

Q1. Define MSIL. Mca2021 5th.


Q2.
Q1.
Q2.
Q1. Describe the architecture of .net framework.
Q1. What is .Net framework. Mca2020 5th.
Q2. What is CLR?
Q3. What is the differences between Vb MDI form and .Net MDI form?
Q1. What are the main components of .NET Framework?
Q2. What is garbage collection? Explain difference between garbage collection in .NET
4.0 and earlier versions.
Q3. What is MSIL? What is the role of the JIT complier in .Net framework?
Q1. Describe in detail the .Net framework architecture with diagram.

Q1. Msc 2022 2no.


Q2.
Q1. What do you know about MSIL.
Q2. Explain JIT and its working.
Q1. Explain .NET framework architecture with diagram. Discuss its advantages.
Or
Describe complete architecture of CLR with diagram. Explain components and
functions of CLR.
Overview of .net framework,
 The .NET Framework is a software development framework for building
and running applications on windows.
 It is designed and developed by Microsoft and the first beta version was
released in 2000.
 It provides a runtime environment, libraries, and tools for building
various types of applications.
 The .NET Framework includes two main components: the Common
Language Runtime (CRL) and the .NET Framework Class Library.
 The CLR is responsible for managing the execution of code written in any
of the supported language.
 While the class library provides a large set of pre-build functions and
classes that can be used to create a wide range of applications.
 One of the key advantages of the .NET Framework is its support for a
variety of programming languages.
Components of .NET Framework
The .NET Framework includes two main components:

1. CLR (Common Language Runtime)


2. FCL (Framework Class Library)

1. CLR (Common Language Runtime):

 The CLR (Common Language Runtime) is a core component of the


Microsoft .NET Framework.
 The CLR is responsible for managing the execution of code written
in any of the supported languages.
 It acts as an interface between the framework and operating system.

1. FCL (Framework Class Library):


 The .NET Framework Class Library(BCL) is a collection of reusable classes
and components.

 the class library provides a large set of pre-build functions and


classes that can be used to create a wide range of applications.

Other components are:


2. CLS (Common Language Specification):
 The CLS is a set of rules and specification within the .NET Framework.
 It defines a common set of features that .NET language should support
to achieve interoperability.

3. CTS (Common Type System):


 CTS defines a common set of data types that all .NET language must
support.
 It ensures consistency and interoperability across different
programming language in the .NET ecosystem.

4. Just-In-Time Compilation (JIT):


 JIT compiler is an important component of CLR. It converts the MSIL
code into native machine code at runtime.

5. Garbage Collection:
 The .NET Framework includes a garbage collector that automatically manages
memory by reclaiming objects that are no longer in use.
 This helps developers avoid memory leaks and ensures efficient use of system
resources.
Managed Execution process,

 Managed Execution Process is a process where Common Language


Runtime (CLR) executes and managed code.

 The CLR is a key component of the .NET Framework responsible for


running managed code.

Here are the steps involved in the managed execution process in .NET-

1. Compilers need to be chosen:


 To obtain the benefits provides by the CLR, you must use one or
more language compiler that target the runtime.

2. Convert the source code to MSIL:


 Compiler translates your source code into Microsoft Intermediate
Language (MSIL) and generate the required metadata.

3. Convert MSIL to native code using JIT:


 In this step, it is also verified if the code is type safe or not.
 At execution time, a Just-in-Time (JIT) compiler converts MSIL to
native code.

4. Running Code:
 The CLR provides the infrastructure that enables execution to take
place and services that can be used during execution.
CLR,

CLR (Common Language Runtime):

 The CLR (Common Language Runtime) is a core component of the


Microsoft .NET Framework.
 The CLR is responsible for managing the execution of code written
in any of the supported languages.
 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 provide security, type-safety, interoperability,
and portability.

The main component of CRL are:

 Common Type System (CTS)


 Common Language Specification (CLS)
 Garbage Collector
 Just-in Time Compiler (JIT)
 Metadata and Assemblies
.Net Framework class library,

FCL (Framework Class Library):

 The .NET Framework Class Library (BCL) is a collection of reusable classes


and components.

 the class library provides a large set of pre-build functions and


classes that can be used to create a wide range of applications.

 It contained thousand of classes that support the following


functions:
 Base and user-defined data type
 Support for exception handling
 Input/output and stream operation
 Communications with the underlying system
 Access to data
 Ability to create windows-based GUI applications
 Ability to create web-client and server applications
 Support for creating web services
common language specification,

CLS (Common Language Specification):

 The CLS is a set of rules and specification within the .NET Framework.

 It defines a common set of features that .NET language should support


to achieve interoperability.

 The common rule make it easy to implement language integration and


help in cross language inheritance and debugging.

 CLS enforces certain naming convention to ensure consistency across


language.

Common Type System,

CTS (Common Type System):


 CTS defines a common set of data types that all .NET language must
support.

 It ensures consistency and interoperability across different


programming language in the .NET ecosystem.

 CTS promotes type safety by providing a common set of data types


that can be used uniformly across languages.

 It enables seamless interoperability between components written in


different languages, as they share a common understanding of data
types.

 A common type system help in writing language independent code.

JIT Compilation,

Just-In-Time Compilation (JIT):

 JIT compiler is an important component of CLR. It converts the MSIL


code into native machine code at runtime.

 The .NET program is compiled either explicitly or implicitly.

 In implicit compilation, the program is compiled twice.

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

 The JIT compiler is required to speed up the code execution and


provide support for multiple plateforms.
MSIL,
 MSIL stands for Microsoft Intermediate Language.
 During the compile time, the compiler convert the all .NET source
code into MSIL.
 MSIL is a CPU-independent set of instructions that can be
efficiently converted to native code.
 During the runtime CLR uses JIT compiler converts the MSIL code
into native code to the operating system.
 It includes instructions for loading, storing, initializing.
 MSIL produces metadata that describes the type in your code.

Assemblies,
 Assemblies are the fundamental unit of deployment and
execution in the .NET Framework.
 They serve as a container for compiled code, metadata, and
resources necessary for a .NET application.
 There are two primary types of assemblies: executable (EXE)
and dynamic link library (DLL).
 EXE assemblies are meant to be executed directly, while DLL are
designed to be referenced and used by other assemblies.
 Assemblies contained compiled code in the form of Microsoft
Intermediate Language (MSIL), ensuring language independence.

metadata,
 Metadata is binary information about the program either store in a
CLR Portable Executable File (PE) along with MSIL code or in the
memory.
 During the execution of MSIL code, 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.
Garbage collection.

Garbage Collection:

 The .NET Framework includes a garbage collector that automatically manages


memory by reclaiming objects that are no longer in use.
 This helps developers avoid memory leaks and ensures efficient use of system
resources.

 Garbage collector is a component of CRL that works as an


automatic memory manager.

 It helps manage memory by automatically allocating memory


according to the requirements.

 It allocates heap memory to objects.

 When objects are not in use, it reclaims the memory allocating to


them for future use.

 It also ensures the safety of objects by not allowing one object to


use the content of another object.
Windows form:
Working with Visual Studio IDE,
creating a .NET solution,

MDI application.
 An MDI (Multiple Document Interface) is a graphical user interface
design pattern where multiple documents or windows are contained
within a single main window.

 It allows the users to work with multiple documents simultaneously


within the context of a unified application.

 In an MDI application, the main window acts as a container that holds


child windows (documents).

 Child windows can be arranged within the main window, and users can
switch between them to perform different tasks.

 Each child window typically represents a separate document, such as a


text file, image, or spreadsheet.
 MDI applications are document-centric, focusing on managing and
displaying multiple documents.

You might also like