SlideShare a Scribd company logo
1 of 34
The Philosophy of .NET
Lecturer: Vahid Farahmandian
https://www.linkedin.com/in/vfarahmandian
CLR, CTS & CLS
• We can refer to .Net as a Runtime Environment and a
comprehensive Base Class Library
• The Runtime layer
 Common Language Runtime (CLR)
 Common Type System (CTS)
 Common Language Specification (CLS)
CLR Roles
1. Locate, Load & Manage .Net objects
2. Take care of:
Memory Management
App Hosting
Coordinating Threads
Performing basic security checks, etc
CTS Roles
1. Describes all possible data types and programming
constructs supported by runtime
2. Specifies how these entities interacts with each
other
3. How they are represented in .Net metadata
CLS Roles
•Essentially no all .Net aware languages might support
every feature defined by CTS.
•CLS defines a subset of common types and
programming constructs that all .Net languages agree
on.
CTS & CLS
Base Class Library(BCL)
What C# Brings to the Table
•Members of C family like Java, C, Objective C, C++
•Supports some features traditionally found in
Functional Languages ex: LISP, Haskell (Lambda
Expr)
•Syntactically clean as Java
•As simple as VB
•As much power and flexibility as C++
Managed vs. Unmanaged Code
• C# only can be used to build apps hosted under the .Net runtime
• Code targeting the .Net runtime  Managed Code
• Binary unit that contains managed code  Assembly
• Code that cannot be directly hosted by .Net Unmanaged Code
An Overview of .NET Assemblies
An Overview of .NET Assemblies
• .Net binaries do not contain platform-specific instruction but rather
platform-agnostic IL and type metadata
IL == MSIL == CIL
•Assembly contains CIL code  is not compiled to platform-
specific instruction until absolutely necessary
•Absolute necessary  referenced for use by the .Net runtime
An Overview of .NET Assemblies
• Assembly also contains metadata(Type Metadata)
• Metadata describes in vivid detail the characteristics of every type
within binary
Ex: Who is the base class? Which interfaces are implemented inside
the given class, etc.
• .Net metadata is always present within assembly & generated by
.Net-aware language compiler
An Overview of .NET Assemblies
•Assemblies themselves are also described using metadata
which is officially termed a manifest(Assembly Manifest).
•Manifest contains information about the current version of
assembly, culture information(used for localizing string etc)
and a list of all externally referenced assemblies
The role of CIL
Ildasm.exe: C:Program Files (x86)Microsoft SDKsWindowsv10.0AbinNETFX XXX Tools
Compiling CIL to Platform-Specific
Instructions
• JIT compiler(Jitter), compiles CIL code into meaningful CPU
instructions(Machine Code)
• Jitter cache the CIL compilation result in memory suited to
the target OS
• Ngen.exe is a command-line tool that perform a pre-JIT of an
assembly in order to improve the startup time(Mostly used
for graphically intensive apps)
The Role of .NET Type Metadata
• Used by intelliSense
• Used by object-browsing utilities
• Used by Debugging tools
• Used by compiler itself
• Used by WCF, Reflection, late binding, serialization etc
• Type Metadata is the backbone of numerous .Net
technologies
The Role of the Assembly Manifest
• Documents all external assemblies
• Assembly version number
• Copyright information, etc
• Like Type metadata, it’s the job of the compiler to generate
the assembly’s manifest
Understanding the CTS
• Type, is a general term used to refer to a member from
the set {class, interface, structure, enumeration,
delegate}
• CTS is a formal specification that documents how
types must be defined in order to be hosted by the
CLR
CTS Class Types
• Every .Net-aware language supports at least the notion
of a class type
• Class is the cornerstone of OOP
• A class may be composed of any number of
members(ctor, properties, methods, events etc)
CTS Interface Types
• Interfaces are nothing more than a named collection of
abstract definitions
• Interfaces are usually declared as public, to allow
types in other assemblies to implement their behavior
CTS Structure Types
• Structure can be thought of as a lightweight class type
having value-based semantics
• Typically are best suited for modeling geometric and
mathematical data
CTS Enumeration Types
• Enumerations allow you to group name-value pairs
• By default storage used to hold each item in
enumeration is a 32 bit integer, however you can alter
this
• Enumerations derive from common base class called
System.Enum which allows you to work better with
enumerations
CTS Delegate Types
• Delegates are critical when you want to provide a way
for one object to forward a call to another
• Delegates provide the foundation for .Net event
architecture
CTS Type Members
• Most types take any number of members
• Type member is constrainted by the set {ctor,
finalizer,static ctor, nested type, operator, method,
property, indexer, field, readonly field, constant event}
• CTS defines various concepts that may be associated
with a given member(ex member’s visibility)
Intrinsic CTS Data Types
• All .Net language keywords ultimately resolve to the
same CTS type defined in as assembly named
mscorlib.dll
Understanding the CLS
CTS is a set of rules that describe in vivid detail the
minimal and complete set of features a given .Net-
aware compiler must support to produce code that can
be hosted by the CLR
Understanding the CLS
CTS is a set of rules that describe in vivid detail the
minimal and complete set of features a given .Net-
aware compiler must support to produce code that can
be hosted by the CLR
[assembly: CLSCompliant(true)] tells the compiler to
check for CLS compliance
Understanding the CLR
•CLR is physically represented by a library named
mscoree.dll
•CLR might interact with the BCL
Asm referenced for usemscoree
loadedmscoree loads required assemblies
Understanding the CLR
Mscoree tasks:
1. Resolving the location for an assembly
2. Finding the requested type within assembly by
reading metadata
3. Lays out the type in memory
4. Compiles the associated CIL into machine code
5. Perform necessary security checks
6. Execute the code
Understanding the CLR
The Assembly/Namespace/Type Distinction
• Namespace is a grouping of semantically related types contained
in an assembly or possibly spread across multiple assemblies
• While defining a type using the fully qualified name provides
greater readability
• using keyword is simply a shorthand notation for specifying a
type’s fully qualified name, and either approach results in the
same underlying CIL (given that CIL code always uses fully
qualified names) and has no effect on performance or the size of
the assembly.
Referencing External Assemblies
• A vast majority of the .NET assemblies are located
under a specific directory termed the global assembly
cache (GAC)
• GAC by default is in : C:WindowsAssemblyGAC
• On a non-windows machine the location of the GAC
depends on the .Net distribution
The Platform-Independent Nature of .NET
The Platform-Independent Nature of .NET

More Related Content

What's hot

Python's dynamic nature (rough slides, November 2004)
Python's dynamic nature (rough slides, November 2004)Python's dynamic nature (rough slides, November 2004)
Python's dynamic nature (rough slides, November 2004)Kiran Jonnalagadda
 
Introduction of jvm|Java Training In Jaipur | Java Training Jaipur | Java Tra...
Introduction of jvm|Java Training In Jaipur | Java Training Jaipur | Java Tra...Introduction of jvm|Java Training In Jaipur | Java Training Jaipur | Java Tra...
Introduction of jvm|Java Training In Jaipur | Java Training Jaipur | Java Tra...Rhythm Suiwal
 
Dotnet interview qa
Dotnet interview qaDotnet interview qa
Dotnet interview qaabcxyzqaz
 
Objective-c for Java Developers
Objective-c for Java DevelopersObjective-c for Java Developers
Objective-c for Java DevelopersMuhammad Abdullah
 
VB.NET:An introduction to Namespaces in .NET framework
VB.NET:An introduction to  Namespaces in .NET frameworkVB.NET:An introduction to  Namespaces in .NET framework
VB.NET:An introduction to Namespaces in .NET frameworkRicha Handa
 
New c sharp4_features_part_iv
New c sharp4_features_part_ivNew c sharp4_features_part_iv
New c sharp4_features_part_ivNico Ludwig
 
Building scalable and language-independent Java services using Apache Thrift ...
Building scalable and language-independent Java services using Apache Thrift ...Building scalable and language-independent Java services using Apache Thrift ...
Building scalable and language-independent Java services using Apache Thrift ...IndicThreads
 
New c sharp4_features_part_iii
New c sharp4_features_part_iiiNew c sharp4_features_part_iii
New c sharp4_features_part_iiiNico Ludwig
 
Building reactive systems with Akka
Building reactive systems with AkkaBuilding reactive systems with Akka
Building reactive systems with AkkaKristof Jozsa
 
Lock-free algorithms for Kotlin Coroutines
Lock-free algorithms for Kotlin CoroutinesLock-free algorithms for Kotlin Coroutines
Lock-free algorithms for Kotlin CoroutinesRoman Elizarov
 

What's hot (18)

Python's dynamic nature (rough slides, November 2004)
Python's dynamic nature (rough slides, November 2004)Python's dynamic nature (rough slides, November 2004)
Python's dynamic nature (rough slides, November 2004)
 
Trans coder
Trans coderTrans coder
Trans coder
 
Introduction of jvm|Java Training In Jaipur | Java Training Jaipur | Java Tra...
Introduction of jvm|Java Training In Jaipur | Java Training Jaipur | Java Tra...Introduction of jvm|Java Training In Jaipur | Java Training Jaipur | Java Tra...
Introduction of jvm|Java Training In Jaipur | Java Training Jaipur | Java Tra...
 
Dotnet interview qa
Dotnet interview qaDotnet interview qa
Dotnet interview qa
 
Objective-c for Java Developers
Objective-c for Java DevelopersObjective-c for Java Developers
Objective-c for Java Developers
 
Rust baksia2014
Rust baksia2014Rust baksia2014
Rust baksia2014
 
VB.NET:An introduction to Namespaces in .NET framework
VB.NET:An introduction to  Namespaces in .NET frameworkVB.NET:An introduction to  Namespaces in .NET framework
VB.NET:An introduction to Namespaces in .NET framework
 
2 common language runtime
2 common language runtime2 common language runtime
2 common language runtime
 
New c sharp4_features_part_iv
New c sharp4_features_part_ivNew c sharp4_features_part_iv
New c sharp4_features_part_iv
 
1 cc
1 cc1 cc
1 cc
 
Building scalable and language-independent Java services using Apache Thrift ...
Building scalable and language-independent Java services using Apache Thrift ...Building scalable and language-independent Java services using Apache Thrift ...
Building scalable and language-independent Java services using Apache Thrift ...
 
DLR MCQs
DLR MCQsDLR MCQs
DLR MCQs
 
New c sharp4_features_part_iii
New c sharp4_features_part_iiiNew c sharp4_features_part_iii
New c sharp4_features_part_iii
 
gcdtmp
gcdtmpgcdtmp
gcdtmp
 
Building reactive systems with Akka
Building reactive systems with AkkaBuilding reactive systems with Akka
Building reactive systems with Akka
 
Lock-free algorithms for Kotlin Coroutines
Lock-free algorithms for Kotlin CoroutinesLock-free algorithms for Kotlin Coroutines
Lock-free algorithms for Kotlin Coroutines
 
Ch6
Ch6Ch6
Ch6
 
Javaiostream
JavaiostreamJavaiostream
Javaiostream
 

Similar to The Philosophy of .Net

Common language runtime clr
Common language runtime clrCommon language runtime clr
Common language runtime clrSanSan149
 
Session2 (3)
Session2 (3)Session2 (3)
Session2 (3)DrUjwala1
 
ASP.NET Session 2
ASP.NET Session 2ASP.NET Session 2
ASP.NET Session 2Sisir Ghosh
 
.Net overview|Introduction Of .net
.Net overview|Introduction Of .net.Net overview|Introduction Of .net
.Net overview|Introduction Of .netpinky singh
 
CS4443 - Modern Programming Language - I Lecture (1)
CS4443 - Modern Programming Language - I Lecture (1)CS4443 - Modern Programming Language - I Lecture (1)
CS4443 - Modern Programming Language - I Lecture (1)Dilawar Khan
 
C#_01_CLROverview.ppt
C#_01_CLROverview.pptC#_01_CLROverview.ppt
C#_01_CLROverview.pptMarcEdwards35
 
.Net programming with C#
.Net programming with C#.Net programming with C#
.Net programming with C#NguynSang29
 
random-140312045902-phpapp01.pdf
random-140312045902-phpapp01.pdfrandom-140312045902-phpapp01.pdf
random-140312045902-phpapp01.pdfPragunSinghal1
 
election survey comapny in delhi|election survey company|election survey comp...
election survey comapny in delhi|election survey company|election survey comp...election survey comapny in delhi|election survey company|election survey comp...
election survey comapny in delhi|election survey company|election survey comp...dnnindia
 
C# Common Type System & Common Language Specification
C# Common Type System & Common Language Specification C# Common Type System & Common Language Specification
C# Common Type System & Common Language Specification Prem Kumar Badri
 
.NET TECHNOLOGIES
.NET TECHNOLOGIES.NET TECHNOLOGIES
.NET TECHNOLOGIESProf Ansari
 

Similar to The Philosophy of .Net (20)

Common language runtime clr
Common language runtime clrCommon language runtime clr
Common language runtime clr
 
Session2 (3)
Session2 (3)Session2 (3)
Session2 (3)
 
ASP.NET Session 2
ASP.NET Session 2ASP.NET Session 2
ASP.NET Session 2
 
.Net overview|Introduction Of .net
.Net overview|Introduction Of .net.Net overview|Introduction Of .net
.Net overview|Introduction Of .net
 
.Net framework
.Net framework.Net framework
.Net framework
 
CS4443 - Modern Programming Language - I Lecture (1)
CS4443 - Modern Programming Language - I Lecture (1)CS4443 - Modern Programming Language - I Lecture (1)
CS4443 - Modern Programming Language - I Lecture (1)
 
C#_01_CLROverview.ppt
C#_01_CLROverview.pptC#_01_CLROverview.ppt
C#_01_CLROverview.ppt
 
.Net programming with C#
.Net programming with C#.Net programming with C#
.Net programming with C#
 
.Net
.Net.Net
.Net
 
random-140312045902-phpapp01.pdf
random-140312045902-phpapp01.pdfrandom-140312045902-phpapp01.pdf
random-140312045902-phpapp01.pdf
 
election survey comapny in delhi|election survey company|election survey comp...
election survey comapny in delhi|election survey company|election survey comp...election survey comapny in delhi|election survey company|election survey comp...
election survey comapny in delhi|election survey company|election survey comp...
 
C# Unit 1 notes
C# Unit 1 notesC# Unit 1 notes
C# Unit 1 notes
 
C# Common Type System & Common Language Specification
C# Common Type System & Common Language Specification C# Common Type System & Common Language Specification
C# Common Type System & Common Language Specification
 
.NET Framework
.NET Framework.NET Framework
.NET Framework
 
.Net slid
.Net slid.Net slid
.Net slid
 
Net framework
Net frameworkNet framework
Net framework
 
.Net framework
.Net framework.Net framework
.Net framework
 
Dotnet1
Dotnet1Dotnet1
Dotnet1
 
.NET TECHNOLOGIES
.NET TECHNOLOGIES.NET TECHNOLOGIES
.NET TECHNOLOGIES
 
Introduction to .Net
Introduction to .NetIntroduction to .Net
Introduction to .Net
 

More from Vahid Farahmandian

More from Vahid Farahmandian (8)

Core C# Programming Constructs, Part 1
Core C# Programming Constructs, Part 1Core C# Programming Constructs, Part 1
Core C# Programming Constructs, Part 1
 
Building C# Applications
Building C# ApplicationsBuilding C# Applications
Building C# Applications
 
C#.net evolution part 2
C#.net evolution part 2C#.net evolution part 2
C#.net evolution part 2
 
Understanding Security in .Net Framework
Understanding Security in .Net FrameworkUnderstanding Security in .Net Framework
Understanding Security in .Net Framework
 
Introduction to SOA
Introduction to SOAIntroduction to SOA
Introduction to SOA
 
Introduction to CRM
Introduction to CRMIntroduction to CRM
Introduction to CRM
 
C#.net Evolution part 1
C#.net Evolution part 1C#.net Evolution part 1
C#.net Evolution part 1
 
Interview tips
Interview tipsInterview tips
Interview tips
 

Recently uploaded

The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 

Recently uploaded (20)

The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 

The Philosophy of .Net

  • 1. The Philosophy of .NET Lecturer: Vahid Farahmandian https://www.linkedin.com/in/vfarahmandian
  • 2. CLR, CTS & CLS • We can refer to .Net as a Runtime Environment and a comprehensive Base Class Library • The Runtime layer  Common Language Runtime (CLR)  Common Type System (CTS)  Common Language Specification (CLS)
  • 3. CLR Roles 1. Locate, Load & Manage .Net objects 2. Take care of: Memory Management App Hosting Coordinating Threads Performing basic security checks, etc
  • 4. CTS Roles 1. Describes all possible data types and programming constructs supported by runtime 2. Specifies how these entities interacts with each other 3. How they are represented in .Net metadata
  • 5. CLS Roles •Essentially no all .Net aware languages might support every feature defined by CTS. •CLS defines a subset of common types and programming constructs that all .Net languages agree on.
  • 8. What C# Brings to the Table •Members of C family like Java, C, Objective C, C++ •Supports some features traditionally found in Functional Languages ex: LISP, Haskell (Lambda Expr) •Syntactically clean as Java •As simple as VB •As much power and flexibility as C++
  • 9. Managed vs. Unmanaged Code • C# only can be used to build apps hosted under the .Net runtime • Code targeting the .Net runtime  Managed Code • Binary unit that contains managed code  Assembly • Code that cannot be directly hosted by .Net Unmanaged Code
  • 10. An Overview of .NET Assemblies
  • 11. An Overview of .NET Assemblies • .Net binaries do not contain platform-specific instruction but rather platform-agnostic IL and type metadata IL == MSIL == CIL •Assembly contains CIL code  is not compiled to platform- specific instruction until absolutely necessary •Absolute necessary  referenced for use by the .Net runtime
  • 12. An Overview of .NET Assemblies • Assembly also contains metadata(Type Metadata) • Metadata describes in vivid detail the characteristics of every type within binary Ex: Who is the base class? Which interfaces are implemented inside the given class, etc. • .Net metadata is always present within assembly & generated by .Net-aware language compiler
  • 13. An Overview of .NET Assemblies •Assemblies themselves are also described using metadata which is officially termed a manifest(Assembly Manifest). •Manifest contains information about the current version of assembly, culture information(used for localizing string etc) and a list of all externally referenced assemblies
  • 14. The role of CIL Ildasm.exe: C:Program Files (x86)Microsoft SDKsWindowsv10.0AbinNETFX XXX Tools
  • 15. Compiling CIL to Platform-Specific Instructions • JIT compiler(Jitter), compiles CIL code into meaningful CPU instructions(Machine Code) • Jitter cache the CIL compilation result in memory suited to the target OS • Ngen.exe is a command-line tool that perform a pre-JIT of an assembly in order to improve the startup time(Mostly used for graphically intensive apps)
  • 16. The Role of .NET Type Metadata • Used by intelliSense • Used by object-browsing utilities • Used by Debugging tools • Used by compiler itself • Used by WCF, Reflection, late binding, serialization etc • Type Metadata is the backbone of numerous .Net technologies
  • 17. The Role of the Assembly Manifest • Documents all external assemblies • Assembly version number • Copyright information, etc • Like Type metadata, it’s the job of the compiler to generate the assembly’s manifest
  • 18. Understanding the CTS • Type, is a general term used to refer to a member from the set {class, interface, structure, enumeration, delegate} • CTS is a formal specification that documents how types must be defined in order to be hosted by the CLR
  • 19. CTS Class Types • Every .Net-aware language supports at least the notion of a class type • Class is the cornerstone of OOP • A class may be composed of any number of members(ctor, properties, methods, events etc)
  • 20. CTS Interface Types • Interfaces are nothing more than a named collection of abstract definitions • Interfaces are usually declared as public, to allow types in other assemblies to implement their behavior
  • 21. CTS Structure Types • Structure can be thought of as a lightweight class type having value-based semantics • Typically are best suited for modeling geometric and mathematical data
  • 22. CTS Enumeration Types • Enumerations allow you to group name-value pairs • By default storage used to hold each item in enumeration is a 32 bit integer, however you can alter this • Enumerations derive from common base class called System.Enum which allows you to work better with enumerations
  • 23. CTS Delegate Types • Delegates are critical when you want to provide a way for one object to forward a call to another • Delegates provide the foundation for .Net event architecture
  • 24. CTS Type Members • Most types take any number of members • Type member is constrainted by the set {ctor, finalizer,static ctor, nested type, operator, method, property, indexer, field, readonly field, constant event} • CTS defines various concepts that may be associated with a given member(ex member’s visibility)
  • 25. Intrinsic CTS Data Types • All .Net language keywords ultimately resolve to the same CTS type defined in as assembly named mscorlib.dll
  • 26. Understanding the CLS CTS is a set of rules that describe in vivid detail the minimal and complete set of features a given .Net- aware compiler must support to produce code that can be hosted by the CLR
  • 27. Understanding the CLS CTS is a set of rules that describe in vivid detail the minimal and complete set of features a given .Net- aware compiler must support to produce code that can be hosted by the CLR [assembly: CLSCompliant(true)] tells the compiler to check for CLS compliance
  • 28. Understanding the CLR •CLR is physically represented by a library named mscoree.dll •CLR might interact with the BCL Asm referenced for usemscoree loadedmscoree loads required assemblies
  • 29. Understanding the CLR Mscoree tasks: 1. Resolving the location for an assembly 2. Finding the requested type within assembly by reading metadata 3. Lays out the type in memory 4. Compiles the associated CIL into machine code 5. Perform necessary security checks 6. Execute the code
  • 31. The Assembly/Namespace/Type Distinction • Namespace is a grouping of semantically related types contained in an assembly or possibly spread across multiple assemblies • While defining a type using the fully qualified name provides greater readability • using keyword is simply a shorthand notation for specifying a type’s fully qualified name, and either approach results in the same underlying CIL (given that CIL code always uses fully qualified names) and has no effect on performance or the size of the assembly.
  • 32. Referencing External Assemblies • A vast majority of the .NET assemblies are located under a specific directory termed the global assembly cache (GAC) • GAC by default is in : C:WindowsAssemblyGAC • On a non-windows machine the location of the GAC depends on the .Net distribution