SlideShare a Scribd company logo
1 of 7
Naveen Kumar Veligeti

.Net Framework:Introduction
.Net Framework is the first step to enter in to the .Net world. A framework can be defined as building
blocks. Similarly .Net Framework can be defined as Building blocks of any .Net application. The .Net
framework contains set of assemblies (in .Net we call all the DLLs as Assemblies) to support different
kind of .Net applications (may be windows based, web based and other applications). Depending
upon the kind of application we would like to develop we can use the corresponding Assemblies
available in the .Net Framework. .Net Framework also contains some Assemblies to execute the .Net
application. So .Net Framework is the collection of Assemblies to support the .Net application
development and .Net application execution.

The Word .Net:We know that .Net Framework is a collection of Assemblies. Now let us know what does the word
.Net mean? There is no reason given by Microsoft for the word ".Net", but you can see some
definitions over the web saying that it is "Network of all technologies", "Next Generation
Technology" and so.

Why do you need .Net?
We have so many technologies available over the world. Now why do we need one more technology
called .Net? Why should I go for .Net? The answer for this question can be

1. Automatic Memory Management
2. Web Services
3. Easy Deployment
4. Interoperability
5. Net Language Independent
Let's look on each briefly,

Automatic Memory Management:The most expensive problem the current VC++ programmers are facing would be 'memory leak'. To
be clear, every new operator we use in our program should be matched with a delete operator. i.e. if
we allocate memory for an object using new keyword then it should be deallocated using the delete

1
Naveen Kumar Veligeti
operator. If we forget to apply delete operator then the memory allocated using the new operator
cannot be used for other purposes. This is called memory leak. In .net there is no place for the term
memory leak, because we don't have to use delete operator on any object. We can use the new
keyword, and forget about delete. .Net will automatically delete the object when that particular
object is no longer used or referenced.

Web Services:Web Services are standardized way to communicate between two entities/processes over web. This
uses XML(eXtensible Markup Language), WSDL (Web Service Description Language), SOAP (Simple
Object Access Protocol), and UDDI (Universal Description, Discovery and Integration). We can think
of this web services as similar to windows services but this web services can also be accessed from
any where over web. .Net has full support to the web services comparing other technologies.

Easy Deployment:In case of .Net applications, the deployment is just a copy and paste. Because all the .Net assemblies
are 'self describing'. We don't need to depend on any header file or registry (like COM components)
or others. Just by copying the files and pasting it in a different machine will complete the
deployment. (However any shared assemblies should be installed into a special folder called
'assembly').

Interoperability:Interoperability can be defined as the ability of a hardware/software to share data between two
applications on different/same machine. Consider we have two applications one is developed in
VC++ and other one is developed in VB. It is not possible to share the data (with out any special
mechanism) from one application to another application as the data type used in one language
cannot be understood by other application.
Most of the applications running now a day were developed using C, C++, COM etc. Moving towards
.Net technology, it is not possible to recreate all the application developed in other technologies so
far. For that purpose .Net has provided a full support for .Net applications to interact with other
applications and vice versa. Any COM component or Win32 application can be communicated easily
with .Net application.

.Net Language Independent:Consider you are creating a DLL using VC++. Now what if you want use this DLL in VB application,
we cannot use the DLL in VB, i.e. cross language interoperability is not supported. But in case of .Net
languages you can create a DLL using C#.Net and use that DLL in VB.Net application. Similarly you
can cross with any .Net languages. Note that only .Net languages can be crossed. VC++.Net and
VC++ are not same (we will see the difference later).

What is .Net?
2
Naveen Kumar Veligeti

So what is .Net? It is not a Language. It is not an operating system. It is a platform to execute
.Net applications.

.Net Architecture:We saw that .Net is platform to execute the .Net applications. Let's now look at the architecture
of the .Net

The above diagram summarizes the architecture; let's look at the each item from the bottom,
Processor: Needless to say all the applications should run in processor.
Operating System: similarly all the application can get the processor time only through the
operating system.
Common Language Runtime: It is usually called as CLR, which is a new layer added for .Net
architecture. This new layer differentiates .Net applications from other applications. Normal windows
applications run directly under the operating system, but any .Net application cannot run directly
under the operating system, all the .Net applications require CLR to be there to get executed.
.Net Framework Assemblies: These are the set of assemblies can be used by our application. .Net
has provided a lot of inbuilt classes and methods which can be used by our application. These classes
and the methods are packed in different assemblies. All these assemblies are collectively called .Net
framework assemblies.
ASP.Net, WinForms, WebServics, Others: These are kind of application we usually develop. ASP.Net
refers to the web based applications, Winforms refers to the Windows based application,
WebServices as seen earlier. And there are other kinds of application we can develop as per the
requirement. Each kind of application uses respective .Net framework assemblies. Not all applications

3
Naveen Kumar Veligeti
use all assemblies. Each application uses related or corresponding assemblies from the .Net
framework.
.Net Languages: These are the programming languages we use to develop our application. We can
choose between any languages as per our comfort. All the languages have the full access to the .Net
framework. (However some .Net features are specially designed for C#).

.Net application Execution Steps:We saw that .Net architecture contains a new layer called CLR, without this layer any .Net
application can not be executed. Now let us see the steps involved in a program execution.

Before starting with .Net application execution let's recollect how a normal C program works.
We write our C code in plain ASCII code, the C compiler converts the ASCII code to binary code
(.exe), this binary code will be executed by the operating system.
But in case of .Net, the compiler will not generate binary code from the ASCII code, instead the
compliers will generate only the MSIL (MicroSoft Intermediate Language) from the ASCII code. This
MSIL will then be converted to binary or native code by the CLR depending upon the target OS. That
is why we need CLR to execute any .Net application as the processor cannot understand the MSIL
code they understand only the binary code.
Why? Why do we want to convert the ASCII to MSIL first then to Native? What is the advantage do
we get?
The reason why do we go for the MSIL step is that, we are getting most of the benefits of .Net
through this MSIL, for e.g. resource management, object lifetime management, reflection, type safe,
some debugging support, etc. To avail these benefits we go for the MSIL step. And these benefits
make the developer's life very easy. Finally we, the developers are rewarded with this MSIL.

Is .Net Platform Independent?
Before answering this question let's recollect what is platform independence. It can be defined as
'compile the code in one platform and run it in any platform'. To be clear the compiler should not
generate any platform specific code as compiler output.

4
Naveen Kumar Veligeti
How java is platform independent? Java compiler generates byte code as complier output. This byte
code is platform independent. And java has JVM for different platform, the byte code can run on any
JVM i.e. any platform. Thus the generated byte code is platform independent.
Coming back to .Net, as we saw, our .Net compliers generates the MSIL code and this MSIL will run
on CLR. This MSIL is not platform specific i.e. it can run on any platform if CLR for the platform is
available. But Microsoft has not provided CLR other than Windows platform. So .Net technology is
platform independent but we don't have CLR for other platforms from Microsoft.

Identifying a .Net application:We saw that we need CLR to run any .Net application. Consider you have two EXEs. One is .Net exe
and other one is normal windows application exe. Both are located in your C drive. When you double
click on an exe the OS (Windows) will handle the click event and will run the exe in the processor. But
incase of .Net exe the CLR has to be loaded to execute the .Net application. So how does the OS
know to load CLR incase of .Net application? To answer this question let's understand the parts of a
.Net assembly/exe.
Any .Net assembly/exe has the following four sections.

PE Header is a normal COFF header used by the operating system. When we double click on any exe
the instruction inside this section will be executed by the OS. In our case, for .Net applications this
section will redirect the OS to the CLR header section.
CLR Header, this is a different section which we have only in .Net assemblies. This section contains
some instructions to load the CLR. This part of header section is responsible to load the CLR (if not
been loaded already) when we try to execute a .Net application. Till now the control is in the hands
of OS, after the CLR is loaded the CLR will take the control of the application from the OS and the
CLR will execute the .Net application. Now the CLR will execute the application from the Main
method available in the MSIL section.
Metadata, initially we saw that all the .Net assemblies are 'self describing'. This metadata section is
responsible self description. This section will contains all the information about the assembly like list
of namespaces, classes it has and methods in each class, parameters, etc.

5
Naveen Kumar Veligeti
MSIL, implementation of all the methods, classes, etc. available in the assembly will be there in this
section in MSIL format. As we saw this is not in binary format. MSIL is like another assembly
language.

Does Language Matter?
We have VB.Net, C#, VC++.Net, J#, etc. languages. Does choosing a language for an application
affects the performance or usability of framework? The answer is NO. All the compliers generate the
MSIL code. Microsoft has provided these many languages to support different syntax. If you are
familiar with VB syntax then you can go for the VB.Net language, if you are familiar with VC++ syntax
you can go for the VC++ language. Choosing a language does not affect the usage of .Net
framework. Al the framework libraries are available for all the languages. And as all the compliers
generate the MSIL it doesn't have any impact on the runtime too. If you are new to any syntax it is
good to use C# as it has got more features.

CLS/CTS:As we saw we have many .Net languages but all the languages produce the MSIL as output. This
MSIL is common. So the target types are shared by all the languages. These target type are the types
that is defined in the MISL. And all the languages have to obey some rules for generating the MSIL
like syntax and types. The rules that should be followed by any .Net languages are called CLS or
Common Language Specification. And there are some set of types in the MSIL that should be
supported by any language as a minimum requirement. These set of types are called CTS or
Common Type System. There are some types outside the CTS, but these type are optional may be
supported by a language. Each language will have its own boundary like the following diagram.

In the above diagram we could see that all the languages supports the CTS minimally and some extra
types. And diagram also shows all the languages obey the rules defined in the CLS. We achieve the
interoperability through this CTS. Since all the .Net languages are expected to support CTS it is
guaranteed that types inside this CTS are fully interoperable.
Having said about CTS/CLS it is also possible to write your own .Net language which will have your
own syntax. But while developing the complier you should keep in mind that you support all the CTS
Types and obey the rules specified in CLS.

6
Naveen Kumar Veligeti

7

More Related Content

What's hot

Dotnet basics
Dotnet basicsDotnet basics
Dotnet basics
Mir Majid
ย 
Vb.net ide
Vb.net ideVb.net ide
Vb.net ide
Faisal Aziz
ย 
.Net framework
.Net framework.Net framework
.Net framework
Arun Pal
ย 
.NET Framework Overview
.NET Framework Overview.NET Framework Overview
.NET Framework Overview
Doncho Minkov
ย 
Dot Net Fundamentals
Dot Net FundamentalsDot Net Fundamentals
Dot Net Fundamentals
LiquidHub
ย 
Migrating To Visual Studio 2008 & .Net Framework 3.5
Migrating To Visual Studio 2008 & .Net Framework 3.5Migrating To Visual Studio 2008 & .Net Framework 3.5
Migrating To Visual Studio 2008 & .Net Framework 3.5
Jeff Blankenburg
ย 
Welcome to the .Net
Welcome to the .NetWelcome to the .Net
Welcome to the .Net
Amr Shawky
ย 

What's hot (20)

Introduction to .net
Introduction to .net Introduction to .net
Introduction to .net
ย 
Dotnet basics
Dotnet basicsDotnet basics
Dotnet basics
ย 
6.origins genesis of .net technology
6.origins genesis of .net technology6.origins genesis of .net technology
6.origins genesis of .net technology
ย 
Vb.net ide
Vb.net ideVb.net ide
Vb.net ide
ย 
Introduction to Dot framework
Introduction to Dot frameworkIntroduction to Dot framework
Introduction to Dot framework
ย 
.Net framework
.Net framework.Net framework
.Net framework
ย 
Evolution of .net frame work
Evolution of .net frame workEvolution of .net frame work
Evolution of .net frame work
ย 
Programming in c#
Programming in c#Programming in c#
Programming in c#
ย 
Introduction to .NET Programming
Introduction to .NET ProgrammingIntroduction to .NET Programming
Introduction to .NET Programming
ย 
Session2 (3)
Session2 (3)Session2 (3)
Session2 (3)
ย 
Java lab lecture 1
Java  lab  lecture 1Java  lab  lecture 1
Java lab lecture 1
ย 
Java lab zero lecture
Java  lab  zero lectureJava  lab  zero lecture
Java lab zero lecture
ย 
.Net framework components by naveen kumar veligeti
.Net framework components by naveen kumar veligeti.Net framework components by naveen kumar veligeti
.Net framework components by naveen kumar veligeti
ย 
Architecture of .net framework
Architecture of .net frameworkArchitecture of .net framework
Architecture of .net framework
ย 
.NET Framework Overview
.NET Framework Overview.NET Framework Overview
.NET Framework Overview
ย 
.NET Framework 4.0 โ€“ Changes & Benefits
.NET Framework 4.0 โ€“ Changes & Benefits .NET Framework 4.0 โ€“ Changes & Benefits
.NET Framework 4.0 โ€“ Changes & Benefits
ย 
Dot Net Fundamentals
Dot Net FundamentalsDot Net Fundamentals
Dot Net Fundamentals
ย 
Migrating To Visual Studio 2008 & .Net Framework 3.5
Migrating To Visual Studio 2008 & .Net Framework 3.5Migrating To Visual Studio 2008 & .Net Framework 3.5
Migrating To Visual Studio 2008 & .Net Framework 3.5
ย 
Vb.net class notes
Vb.net class notesVb.net class notes
Vb.net class notes
ย 
Welcome to the .Net
Welcome to the .NetWelcome to the .Net
Welcome to the .Net
ย 

Viewers also liked (13)

Curriculum Vitae
Curriculum VitaeCurriculum Vitae
Curriculum Vitae
ย 
Mohamed favas
Mohamed favasMohamed favas
Mohamed favas
ย 
Superior Web-based fulfillment system for electronic design automation leader.
Superior Web-based fulfillment system for electronic design automation leader.Superior Web-based fulfillment system for electronic design automation leader.
Superior Web-based fulfillment system for electronic design automation leader.
ย 
Cody Resume
Cody ResumeCody Resume
Cody Resume
ย 
Michel Alexandre Salim\'s resume
Michel Alexandre Salim\'s resumeMichel Alexandre Salim\'s resume
Michel Alexandre Salim\'s resume
ย 
AM 2015 Resume
AM 2015 ResumeAM 2015 Resume
AM 2015 Resume
ย 
Resume 2014
Resume 2014Resume 2014
Resume 2014
ย 
Resume Update 2016 (LA)
Resume Update 2016 (LA)Resume Update 2016 (LA)
Resume Update 2016 (LA)
ย 
CV
CVCV
CV
ย 
azhar_Mohammed_INF
azhar_Mohammed_INFazhar_Mohammed_INF
azhar_Mohammed_INF
ย 
Tyler Jones Resume new
Tyler Jones Resume newTyler Jones Resume new
Tyler Jones Resume new
ย 
Charles w.-colby-resume amazon 1.18.16
Charles w.-colby-resume amazon 1.18.16Charles w.-colby-resume amazon 1.18.16
Charles w.-colby-resume amazon 1.18.16
ย 
Edward stewart 2016v3
Edward stewart 2016v3Edward stewart 2016v3
Edward stewart 2016v3
ย 

Similar to .Net framework by naveen kumar veligeti

The Seven Pillars Of Asp.Net
The Seven Pillars Of Asp.NetThe Seven Pillars Of Asp.Net
The Seven Pillars Of Asp.Net
Anand Kumar Rajana
ย 
.Net framework
.Net framework.Net framework
.Net framework
Raghu nath
ย 
tybsc it asp.net full unit 1,2,3,4,5,6 notes
tybsc it asp.net full unit 1,2,3,4,5,6 notestybsc it asp.net full unit 1,2,3,4,5,6 notes
tybsc it asp.net full unit 1,2,3,4,5,6 notes
WE-IT TUTORIALS
ย 
Chapter1
Chapter1Chapter1
Chapter1
guest9ccd0e
ย 
Automatic answer checker
Automatic answer checkerAutomatic answer checker
Automatic answer checker
Yesu Raj
ย 
Inside .net framework
Inside .net frameworkInside .net framework
Inside .net framework
Faisal Aziz
ย 

Similar to .Net framework by naveen kumar veligeti (20)

Dotnet Basics Presentation
Dotnet Basics PresentationDotnet Basics Presentation
Dotnet Basics Presentation
ย 
The Seven Pillars Of Asp.Net
The Seven Pillars Of Asp.NetThe Seven Pillars Of Asp.Net
The Seven Pillars Of Asp.Net
ย 
The seven pillars of aspnet
The seven pillars of aspnetThe seven pillars of aspnet
The seven pillars of aspnet
ย 
Unit I- Introduction to .NET Framework.pdf
Unit I- Introduction to .NET Framework.pdfUnit I- Introduction to .NET Framework.pdf
Unit I- Introduction to .NET Framework.pdf
ย 
Tutorial c#
Tutorial c#Tutorial c#
Tutorial c#
ย 
Dot net-interview-questions-and-answers part i
Dot net-interview-questions-and-answers part iDot net-interview-questions-and-answers part i
Dot net-interview-questions-and-answers part i
ย 
Dot net-interview-questions-and-answers part i
Dot net-interview-questions-and-answers part iDot net-interview-questions-and-answers part i
Dot net-interview-questions-and-answers part i
ย 
Programming
Programming Programming
Programming
ย 
Dot net interview_questions
Dot net interview_questionsDot net interview_questions
Dot net interview_questions
ย 
Dot net interview_questions
Dot net interview_questionsDot net interview_questions
Dot net interview_questions
ย 
.Net framework
.Net framework.Net framework
.Net framework
ย 
Introduction to .net
Introduction to .netIntroduction to .net
Introduction to .net
ย 
tybsc it asp.net full unit 1,2,3,4,5,6 notes
tybsc it asp.net full unit 1,2,3,4,5,6 notestybsc it asp.net full unit 1,2,3,4,5,6 notes
tybsc it asp.net full unit 1,2,3,4,5,6 notes
ย 
.Net introduction by Quontra Solutions
.Net introduction by Quontra Solutions.Net introduction by Quontra Solutions
.Net introduction by Quontra Solutions
ย 
Net Interview questions
Net Interview questionsNet Interview questions
Net Interview questions
ย 
Chapter1
Chapter1Chapter1
Chapter1
ย 
Automatic answer checker
Automatic answer checkerAutomatic answer checker
Automatic answer checker
ย 
dot NET Framework
dot NET Frameworkdot NET Framework
dot NET Framework
ย 
Inside .net framework
Inside .net frameworkInside .net framework
Inside .net framework
ย 
Windows 8 App Development
Windows 8 App DevelopmentWindows 8 App Development
Windows 8 App Development
ย 

More from Naveen Kumar Veligeti (7)

Basic CSS concepts by naveen kumar veligeti
Basic CSS concepts by naveen kumar veligetiBasic CSS concepts by naveen kumar veligeti
Basic CSS concepts by naveen kumar veligeti
ย 
Php forms and validations by naveen kumar veligeti
Php forms and validations by naveen kumar veligetiPhp forms and validations by naveen kumar veligeti
Php forms and validations by naveen kumar veligeti
ย 
Why use .net by naveen kumar veligeti
Why use .net by naveen kumar veligetiWhy use .net by naveen kumar veligeti
Why use .net by naveen kumar veligeti
ย 
Types of sql commands by naveen kumar veligeti
Types of sql commands by naveen kumar veligetiTypes of sql commands by naveen kumar veligeti
Types of sql commands by naveen kumar veligeti
ย 
Sql data types for various d bs by naveen kumar veligeti
Sql data types for various d bs by naveen kumar veligetiSql data types for various d bs by naveen kumar veligeti
Sql data types for various d bs by naveen kumar veligeti
ย 
Beginners introduction to asp.net
Beginners introduction to asp.netBeginners introduction to asp.net
Beginners introduction to asp.net
ย 
Clauses in sql server
Clauses in sql serverClauses in sql server
Clauses in sql server
ย 

Recently uploaded

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
ย 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
ย 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
ย 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
ย 

Recently uploaded (20)

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ย 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
ย 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
ย 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
ย 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
ย 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
ย 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
ย 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
ย 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
ย 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
ย 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
ย 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
ย 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
ย 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
ย 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
ย 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
ย 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
ย 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
ย 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
ย 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
ย 

.Net framework by naveen kumar veligeti

  • 1. Naveen Kumar Veligeti .Net Framework:Introduction .Net Framework is the first step to enter in to the .Net world. A framework can be defined as building blocks. Similarly .Net Framework can be defined as Building blocks of any .Net application. The .Net framework contains set of assemblies (in .Net we call all the DLLs as Assemblies) to support different kind of .Net applications (may be windows based, web based and other applications). Depending upon the kind of application we would like to develop we can use the corresponding Assemblies available in the .Net Framework. .Net Framework also contains some Assemblies to execute the .Net application. So .Net Framework is the collection of Assemblies to support the .Net application development and .Net application execution. The Word .Net:We know that .Net Framework is a collection of Assemblies. Now let us know what does the word .Net mean? There is no reason given by Microsoft for the word ".Net", but you can see some definitions over the web saying that it is "Network of all technologies", "Next Generation Technology" and so. Why do you need .Net? We have so many technologies available over the world. Now why do we need one more technology called .Net? Why should I go for .Net? The answer for this question can be 1. Automatic Memory Management 2. Web Services 3. Easy Deployment 4. Interoperability 5. Net Language Independent Let's look on each briefly, Automatic Memory Management:The most expensive problem the current VC++ programmers are facing would be 'memory leak'. To be clear, every new operator we use in our program should be matched with a delete operator. i.e. if we allocate memory for an object using new keyword then it should be deallocated using the delete 1
  • 2. Naveen Kumar Veligeti operator. If we forget to apply delete operator then the memory allocated using the new operator cannot be used for other purposes. This is called memory leak. In .net there is no place for the term memory leak, because we don't have to use delete operator on any object. We can use the new keyword, and forget about delete. .Net will automatically delete the object when that particular object is no longer used or referenced. Web Services:Web Services are standardized way to communicate between two entities/processes over web. This uses XML(eXtensible Markup Language), WSDL (Web Service Description Language), SOAP (Simple Object Access Protocol), and UDDI (Universal Description, Discovery and Integration). We can think of this web services as similar to windows services but this web services can also be accessed from any where over web. .Net has full support to the web services comparing other technologies. Easy Deployment:In case of .Net applications, the deployment is just a copy and paste. Because all the .Net assemblies are 'self describing'. We don't need to depend on any header file or registry (like COM components) or others. Just by copying the files and pasting it in a different machine will complete the deployment. (However any shared assemblies should be installed into a special folder called 'assembly'). Interoperability:Interoperability can be defined as the ability of a hardware/software to share data between two applications on different/same machine. Consider we have two applications one is developed in VC++ and other one is developed in VB. It is not possible to share the data (with out any special mechanism) from one application to another application as the data type used in one language cannot be understood by other application. Most of the applications running now a day were developed using C, C++, COM etc. Moving towards .Net technology, it is not possible to recreate all the application developed in other technologies so far. For that purpose .Net has provided a full support for .Net applications to interact with other applications and vice versa. Any COM component or Win32 application can be communicated easily with .Net application. .Net Language Independent:Consider you are creating a DLL using VC++. Now what if you want use this DLL in VB application, we cannot use the DLL in VB, i.e. cross language interoperability is not supported. But in case of .Net languages you can create a DLL using C#.Net and use that DLL in VB.Net application. Similarly you can cross with any .Net languages. Note that only .Net languages can be crossed. VC++.Net and VC++ are not same (we will see the difference later). What is .Net? 2
  • 3. Naveen Kumar Veligeti So what is .Net? It is not a Language. It is not an operating system. It is a platform to execute .Net applications. .Net Architecture:We saw that .Net is platform to execute the .Net applications. Let's now look at the architecture of the .Net The above diagram summarizes the architecture; let's look at the each item from the bottom, Processor: Needless to say all the applications should run in processor. Operating System: similarly all the application can get the processor time only through the operating system. Common Language Runtime: It is usually called as CLR, which is a new layer added for .Net architecture. This new layer differentiates .Net applications from other applications. Normal windows applications run directly under the operating system, but any .Net application cannot run directly under the operating system, all the .Net applications require CLR to be there to get executed. .Net Framework Assemblies: These are the set of assemblies can be used by our application. .Net has provided a lot of inbuilt classes and methods which can be used by our application. These classes and the methods are packed in different assemblies. All these assemblies are collectively called .Net framework assemblies. ASP.Net, WinForms, WebServics, Others: These are kind of application we usually develop. ASP.Net refers to the web based applications, Winforms refers to the Windows based application, WebServices as seen earlier. And there are other kinds of application we can develop as per the requirement. Each kind of application uses respective .Net framework assemblies. Not all applications 3
  • 4. Naveen Kumar Veligeti use all assemblies. Each application uses related or corresponding assemblies from the .Net framework. .Net Languages: These are the programming languages we use to develop our application. We can choose between any languages as per our comfort. All the languages have the full access to the .Net framework. (However some .Net features are specially designed for C#). .Net application Execution Steps:We saw that .Net architecture contains a new layer called CLR, without this layer any .Net application can not be executed. Now let us see the steps involved in a program execution. Before starting with .Net application execution let's recollect how a normal C program works. We write our C code in plain ASCII code, the C compiler converts the ASCII code to binary code (.exe), this binary code will be executed by the operating system. But in case of .Net, the compiler will not generate binary code from the ASCII code, instead the compliers will generate only the MSIL (MicroSoft Intermediate Language) from the ASCII code. This MSIL will then be converted to binary or native code by the CLR depending upon the target OS. That is why we need CLR to execute any .Net application as the processor cannot understand the MSIL code they understand only the binary code. Why? Why do we want to convert the ASCII to MSIL first then to Native? What is the advantage do we get? The reason why do we go for the MSIL step is that, we are getting most of the benefits of .Net through this MSIL, for e.g. resource management, object lifetime management, reflection, type safe, some debugging support, etc. To avail these benefits we go for the MSIL step. And these benefits make the developer's life very easy. Finally we, the developers are rewarded with this MSIL. Is .Net Platform Independent? Before answering this question let's recollect what is platform independence. It can be defined as 'compile the code in one platform and run it in any platform'. To be clear the compiler should not generate any platform specific code as compiler output. 4
  • 5. Naveen Kumar Veligeti How java is platform independent? Java compiler generates byte code as complier output. This byte code is platform independent. And java has JVM for different platform, the byte code can run on any JVM i.e. any platform. Thus the generated byte code is platform independent. Coming back to .Net, as we saw, our .Net compliers generates the MSIL code and this MSIL will run on CLR. This MSIL is not platform specific i.e. it can run on any platform if CLR for the platform is available. But Microsoft has not provided CLR other than Windows platform. So .Net technology is platform independent but we don't have CLR for other platforms from Microsoft. Identifying a .Net application:We saw that we need CLR to run any .Net application. Consider you have two EXEs. One is .Net exe and other one is normal windows application exe. Both are located in your C drive. When you double click on an exe the OS (Windows) will handle the click event and will run the exe in the processor. But incase of .Net exe the CLR has to be loaded to execute the .Net application. So how does the OS know to load CLR incase of .Net application? To answer this question let's understand the parts of a .Net assembly/exe. Any .Net assembly/exe has the following four sections. PE Header is a normal COFF header used by the operating system. When we double click on any exe the instruction inside this section will be executed by the OS. In our case, for .Net applications this section will redirect the OS to the CLR header section. CLR Header, this is a different section which we have only in .Net assemblies. This section contains some instructions to load the CLR. This part of header section is responsible to load the CLR (if not been loaded already) when we try to execute a .Net application. Till now the control is in the hands of OS, after the CLR is loaded the CLR will take the control of the application from the OS and the CLR will execute the .Net application. Now the CLR will execute the application from the Main method available in the MSIL section. Metadata, initially we saw that all the .Net assemblies are 'self describing'. This metadata section is responsible self description. This section will contains all the information about the assembly like list of namespaces, classes it has and methods in each class, parameters, etc. 5
  • 6. Naveen Kumar Veligeti MSIL, implementation of all the methods, classes, etc. available in the assembly will be there in this section in MSIL format. As we saw this is not in binary format. MSIL is like another assembly language. Does Language Matter? We have VB.Net, C#, VC++.Net, J#, etc. languages. Does choosing a language for an application affects the performance or usability of framework? The answer is NO. All the compliers generate the MSIL code. Microsoft has provided these many languages to support different syntax. If you are familiar with VB syntax then you can go for the VB.Net language, if you are familiar with VC++ syntax you can go for the VC++ language. Choosing a language does not affect the usage of .Net framework. Al the framework libraries are available for all the languages. And as all the compliers generate the MSIL it doesn't have any impact on the runtime too. If you are new to any syntax it is good to use C# as it has got more features. CLS/CTS:As we saw we have many .Net languages but all the languages produce the MSIL as output. This MSIL is common. So the target types are shared by all the languages. These target type are the types that is defined in the MISL. And all the languages have to obey some rules for generating the MSIL like syntax and types. The rules that should be followed by any .Net languages are called CLS or Common Language Specification. And there are some set of types in the MSIL that should be supported by any language as a minimum requirement. These set of types are called CTS or Common Type System. There are some types outside the CTS, but these type are optional may be supported by a language. Each language will have its own boundary like the following diagram. In the above diagram we could see that all the languages supports the CTS minimally and some extra types. And diagram also shows all the languages obey the rules defined in the CLS. We achieve the interoperability through this CTS. Since all the .Net languages are expected to support CTS it is guaranteed that types inside this CTS are fully interoperable. Having said about CTS/CLS it is also possible to write your own .Net language which will have your own syntax. But while developing the complier you should keep in mind that you support all the CTS Types and obey the rules specified in CLS. 6