SlideShare a Scribd company logo
 
Microsoft  .NET Framework Overview Svetlin Nakov Software Development Consultant, Part-time Computer Science Lecturer Sofia University “St. Kliment Ohridski” http:// www.nakov.com
.NET Enterprise Vision ERP & Billing Customer Service Sales Users Any device, Any place, Any time XML Web Services Integrate business applications and processes Back Office Heterogeneous application and server infrastructure Scheduling Authentication Notification
So what is .NET? .NET is a platform that provides a standardized set of services. It’s just like Windows, except distributed over the Internet. It exports a common interface so that it’s programs can be run on any system that supports .NET. A specific software framework Includes a common runtime
.NET Framework Programming model for .NET Platform for running .NET managed code in a virtual machine Provides a very good environment to develop networked applications and Web Services Provides programming API and unified language-independent development framework
The Core of .NET   Framework: FCL & CLR Common Language Runtime Garbage collection Language integration Multiple versioning support  (no more DLL hell!) Integrated security Framework Class Library Provides the core functionality: ASP.NET, Web Services, ADO.NET, Windows Forms, IO, XML, etc.
.NET Framework   Common Language Runtime CLR manages code execution at runtime Memory management, thread management, etc. Operating System Common Language Runtime
.NET Framework   Base Class Library Object-oriented collection of reusable types Collections, I/O, Strings, … Operating System Common Language Runtime .NET Framework (Base Class Library)
.NET Framework   Data Access Layer Access relational databases Disconnected data model Work with XML Operating System Common Language Runtime .NET Framework (Base Class Library) ADO .NET and XML
.NET Framework   ASP.NET & Windows Forms Create application’s front-end – Web-based user interface, Windows GUI, Web services, … Operating System Common Language Runtime .NET Framework (Base Class Library) ADO .NET and XML ASP .NET Web Forms  Web Services Mobile Internet Toolkit Windows Forms
.NET Framework   Programming Languages Use your favorite language Operating System Common Language Runtime C++ C# VB.NET Perl J# … .NET Framework (Base Class Library) ADO .NET and XML ASP .NET Web Forms  Web Services Mobile Internet Toolkit Windows Forms
.NET Framework   Common Language Specification Operating System Common Language Runtime Common Language Specification .NET Framework (Base Class Library) ADO .NET and XML ASP .NET Web Forms  Web Services Mobile Internet Toolkit Windows Forms C++ C# VB Perl J# …
.NET Framework   Visual Studio .NET Operating System Common Language Runtime Common Language Specification C++ C# VB Perl J# … Visual Studio .NET .NET Framework (Base Class Library) ADO .NET and XML ASP .NET Web Forms  Web Services Mobile Internet Toolkit Windows Forms
.NET Framework   Standards Compliance Operating System Common Language Runtime Common Language Specification C++ C# VB Perl J# … Visual Studio .NET .NET Framework (Base Class Library) ADO .NET and XML ASP .NET Web Services Web Forms Mobile Internet Toolkit Windows Forms Open Language Specification C# Language – Submitted to ECMA XML-based data access Web services – XML, SOAP-based
Common Language Runtime Manages running code – like a virtual machine Threading Memory management No interpreter: JIT-compiler produces native code – during the program installation or at run time Fine-grained evidence-based security Code access security Code can be verified to guarantee type safety No unsafe casts, no un-initialized variables and  no out-of-bounds array indexing Role-based security
Managed Code Code that targets the CLR is referred to as managed code All managed code has the features of the CLR Object-oriented Type-safe Cross-language integration Cross language exception handling Multiple version support Managed code is represented in special Intermediate Language (IL)
Automatic Memory Management The CLR manages memory for managed code All allocations of objects and buffers made from a  Managed Heap Unused objects and buffers are cleaned up automatically through  Garbage Collection Some of the worst bugs in software development are not possible with managed code Leaked memory or objects References to freed or non-existent objects Reading of uninitialised variables Pointerless  environment
Multiple Language Support IL (MSIL or CIL) – Intermediate Language It is low-level (machine) language, like Assembler, but is Object-oriented   CTS is a rich type system built into the CLR Implements various types ( int , float, string, …) And operations on those types CLS is a set of specifications that all languages and libraries need to follow This will ensure interoperability between languages
Intermediate Language .NET languages are compiled to an Intermediate Language (IL) IL is also known as MSIL or CIL CLR compiles IL in just-in-time (JIT) manner – each function is compiled just before execution The JIT code stays in memory for subsequent calls Recompilations of assemblies are also possible
Example of MSIL Code .method private hidebysig static void  Main() cil managed { .entrypoint // Code size  11 (0xb) .maxstack  8 IL_0000:  ldstr  "Hello, world!" IL_0005:  call  void [mscorlib]System.Console::WriteLine(string) IL_000a:  ret } // end of method HelloWorld::Main
Common Type System (CTS) All .NET languages have the same primitive data types.  An  int  in C# is the same as an  int  in VB.NET When communicating between modules written in any .NET language, the types are guaranteed to be compatible on the binary level Types can be: Value types – passed by value, stored in the stack Reference types – passed by reference, stored in the heap Strings are a primitive data type now
Common Language Specification (CLS) Any language that conforms to the CLS is a .NET language A language that conforms to the CLS has the ability to take full advantage of the Framework Class Library (FCL) CLS is standardized by ECMA
.NET Languages Languages provided by Microsoft C++, C#, J#, VB.NET,  JScript Third-parties languages Perl, Python, Pascal, APL, COBOL, Eiffel, Haskell, ML, Oberon, Scheme, Smalltalk… Advanced multi-language features Cross-language inheritance and exceptions handling Object system is built in, not bolted on No additional rules or API to learn
C# Language Mixture between C++, Java and Delphi Component-oriented Properties, Methods, Events Attributes, XML documentation All in one place, no header files, IDL, etc. Can be embedded in ASP+ pages Everything really is an object Primitive types aren’t magic Unified type system == Deep simplicity Improved extensibility and reusability
C# Language – Example using System; class HelloWorld { public static void main() { Console.WriteLine(“Hello, world!”); } }
Code Compilation and Execution Compilation Before installation or the first time each method is called Execution Also called Assembly (.EXE or .DLL file) JIT Compiler Native Code MSIL Code Metadata Source Code Language Compiler
Assemblies DLL or EXE file Smallest deployable unit in the CLR Have unique version number No version conflicts (known as DLL hell) Contains IL code to be executed Security boundary – permissions are granted at the assembly level Type boundary – all types include the assembly name they are a part of Self-describing manifest – metadata that describes the types in the assembly
Metadata in Assembly Type Descriptions Classes Base classes Implemented interfaces Data members Methods Name Version Culture Assembly Description Other assemblies Security Permissions Exported Types
Applications One or more assemblies Assemblies conflict resolution Using metadata Local (preferred) Global Assembly Cache (GAC) Different applications may use different versions of an assembly Easier software updates Easier software removal
Visual Studio .NET Development tool that contains a rich set of productivity and debugging features Supports managed and unmanaged applications Supports C#, C++, VB.NET, … Many useful tools and wizards Windows Forms Designer ASP.NET Web Forms Designer Web Services support SQL Server integration with ADO.NET and XML VS.NET is not part of the .NET Framework Not necessary to build or run managed code The .NET Framework SDK includes command line compilers
VS.NET – Single Development Environment & Skill Set From Visual Studio.NET you can: Write code Design user interface Study documentation Debug Test Deploy Same tools for all languages Same tools for all platforms
Visual Studio .NET
The .NET Framework Library Base Class Library ADO.NET and XML Web Forms  Web Services Mobile Internet Toolkit Windows Forms ASP.NET
.NET Framework Namespaces System  Globalization Diagnostics Configuration Collections Resources Reflection Net IO Threading Text ServiceProcess Security Runtime InteropServices Remoting Serialization System.Data Design ADO SQLTypes SQL System.Xml XPath XSLT Serialization System.Web Configuration SessionState Caching Security Services UI HtmlControls WebControls Description Discovery Protocols System.Drawing Imaging Drawing2D Text Printing System.WinForms Design ComponentModel
Base Class Library Namespaces System Threading Text ServiceProcess Security Resources Reflection Net IO Globalization Diagnostics Configuration Collections Runtime Serialization Remoting InteropServices
Base Class Library Data types, conversions, formatting Collections:  ArrayList, Hashtable , etc. Globalization:  Cultures, sorting, etc. I/O:  Binary and text streams, files, etc. Networking:  HTTP, TCP/IP sockets, etc. Reflection:  Metadata and IL emit Security:  Permissions, cryptography Text:  Encodings, regular expressions
Data And XML Namespaces System.Data SQLTypes SQLClient Common OleDb System.Xml Serialization XPath XSLT
ADO.NET And XML ADO.NET consumes all types of data XML (hierarchical), relational, etc. Powerful in-memory data cache (DataSet) DataSet contains various data objects: tables, views, relations, constraints, etc. Lightweight, stateless, disconnected Supports both relational and XML access High-performance, low overhead stream access Great XML support including:  W3C DOM, XSL/T, XPath, and Schema
VS.NET – DataSet Designer
Windows Forms Namespaces System.Drawing Drawing2D Imaging Printing Text System.Windows.Forms Design ComponentModel
Windows Forms Windows Forms is framework for building rich GUI applications RAD (Rapid Application Development) component-based event-driven Rich set of controls Data aware components ActiveX® Support Printing support Unicode support UI inheritance
Windows Forms Combines VB and Delphi forms with the power of MFC Delegation as well as subclassing Advanced features Visual forms inheritance, automatic layout Advanced graphics support – GDI+ Easy access to Win32 ®  API Controls can be hosted in IE 5.x No installation, registration or  GUIDs Code access security
VS.NET – Windows Forms Designer
Demo Create simple database application with: Windows Forms ADO.NET MS SQL Server Visual Studio .NET
ASP.NET Namespaces System.Web Caching Configuration Services UI SessionState HtmlControls WebControls Description Discovery Security Protocols
Framework for building Web applications and Web services in any .NET language C#, C++, VB.NET,  JScript , etc. Automatic multiple clients support DHTML, HTML 3.2, WML, small devices Compilation of ASP.NET Web applications into .NET assemblies Cached the first time when called All subsequent calls use the cached version Separation of code and content Developers and designers can work independently ASP.NET
ASP.NET Rich page architecture – “Web Forms” Rich set of ASP.NET server controls Data validation Data bound grids Event-driven execution model Great Web-services support Easy to deploy High reliability and availability High performance and scalability Scalable handling of state information
VS.NET – Web Forms Designer
Demo Create simple Web-based database application with: ASP.NET (Web Forms) ADO.NET MS SQL Server Visual Studio .NET
Web Services Technical definition – “A programmable application component accessible via standard Web protocols” Built on XML and SOAP Expose functionality from Web Sites Almost like component programming over the Web Functionality exposed using XML/HTML Standard Web Services include Calendar MSN Passport
XML Web Services Foundation Simple, Open, Broad Industry Support Open standards: Ubiquitous Communications:  Internet Universal Data Format: XML Service Interactions: SOAP Publish, Find, Use Services: UDDI
ASP.NET Web Services Simple programming model Author .ASMX files with class methods ASP.NET compiles on demand, generates WSDL contract, exposes HTML test page Incoming HTTP/SOAP messages invoke methods No special HTTP, SOAP or XML knowledge required Supports multiple message wire formats HTTP GET, POST, and SOAP Requests
Web Service Example in C# ParcelTracker.asmx <%@ WebService Language=&quot;C#&quot; %> using System; using System.Web.Services; public class ParcelTrackerWebService { [WebMethod] public string GetOrderStatus(int orderNumber) { //   Implementation here } }
.NET Framework on Linux Mono Project Open Source C# compiler, CLR and Framework Class Library Runs on various platforms and hardware: Linux, Unix, FreeBSD, Windows – JIT-compiler for x86 s390, SPARC ,  PowerPC  – interpreter for these hardware architectures Supports also: ADO.NET and XML Windows Forms (not fully) ASP.NET Web Services
.NET Framework on Linux (2) Mono Project Runs .NET portable executables on Linux, e.g. mono myapp.exe Compiles .NET applications to portable executables, e.g. mcs myapp.cs The obtained .exe file can taken and run on Windows DotGNU Portable.NET Build and execute .NET applications on  GNU/Linux ,  Windows, Solaris, NetBSD, FreeBSD, and MacOS X
Summary .NET Framework is a code execution platform – the environment which .NET programs run .NET Framework consists of two primary parts: Common Language Runtime and .NET Class Libraries The CLS (Common Language Specification) allows different languages to interact seamlessly. The CTS (Common Type System) allows all languages to share base data types.
Summary (2) .NET languages are compiled to MSIL by their respective compilers MSIL code is compiled to machine code by the JIT compiler All .NET languages have equal access to the FCL (Framework Class Library) which is a rich set of classes for developing software Base Class Library is set of basic classes:  Collections, I/O, Networking, Security, etc. ADO.NET provides .NET applications with access to relational databases
Summary (3) .NET has great XML support including: DOM, XSLT,  XPath , and  XSchema Windows Forms provides GUI interface for the .NET applications ASP.NET allows creating web interface to .NET applications Web Services expose functionality from web sites and make it remotely accessible through standard XML-based protocols Visual Studio .NET is powerful development IDE for all .NET languages and technologies
.NET Framework – Resources Visit following web sites: . NET Framework Home Site –  http://msdn.microsoft.com/netframework/ The Microsoft .NET Framework Community –  http://www.gotdotnet.com/ ASP.NET –  http://www.asp.net/ .NET Windows Forms –  http://www.windowsforms.net/ Code Project –  http://www.codeproject.net/ Mono – Open Source .NET Framework  –  http://www.go-mono.org/ Rotor – Shared Source .NET CLI –  http://msdn.microsoft.com/net/sscli/   Read the news groups: news:// msnews.microsoft.com / microsoft.public.dotnet.framework
Questions?

More Related Content

PPT
Introduction to .NET Framework
PPTX
Dotnet Basics Presentation
PDF
PUC SE Day 2019 - SpringBoot
PPT
Developing an ASP.NET Web Application
PPTX
Advance Java Topics (J2EE)
PPT
PDF
Basic Java Programming
PPSX
Introduction to .net framework
Introduction to .NET Framework
Dotnet Basics Presentation
PUC SE Day 2019 - SpringBoot
Developing an ASP.NET Web Application
Advance Java Topics (J2EE)
Basic Java Programming
Introduction to .net framework

What's hot (20)

PPT
Introduction to Eclipse IDE
PPTX
Microsoft dot net framework
PPSX
PPTX
Introduction to ASP.NET
PPTX
Introduction to .NET Core
PPT
Introduction to .net
PPT
C# Basics
PDF
Object-oriented Programming-with C#
PPTX
Spring boot
PDF
SELENIUM PPT.pdf
PPT
Selenium ppt
PPTX
dot net technology
PDF
Web automation using selenium.ppt
PPTX
Introduction to java
PPT
MVC ppt presentation
PPSX
C# - Part 1
PDF
TypeScript - An Introduction
PPTX
C# Framework class library
PPTX
C# in depth
Introduction to Eclipse IDE
Microsoft dot net framework
Introduction to ASP.NET
Introduction to .NET Core
Introduction to .net
C# Basics
Object-oriented Programming-with C#
Spring boot
SELENIUM PPT.pdf
Selenium ppt
dot net technology
Web automation using selenium.ppt
Introduction to java
MVC ppt presentation
C# - Part 1
TypeScript - An Introduction
C# Framework class library
C# in depth
Ad

Similar to Nakov - .NET Framework Overview - English (20)

PPT
Best DotNet Training in Delhi
PPTX
.Net Framework
PPT
Intro.net
PPT
Introduction to ,NET Framework
PPT
Microsoft .NET Framework
PPT
Microsoft.Net
PPT
Microsoft .NET (dotnet) Framework 2003 - 2004 overview and web services…
PPT
.Net framework
PPT
Dotnet framework
PPT
Nakov dot net-framework-overview-english
PPT
Modified.net overview
PPTX
Introduction to .NET by QuontraSolutions
PPTX
Presentation1
PPT
Visual studio.net
PPT
.net framework
PPT
Introduction To Dotnet
PPSX
Introduction to C#
PPT
As Pdotnet
PPT
Inside .net framework
PPT
SynapseIndia dotnet web development architecture module
Best DotNet Training in Delhi
.Net Framework
Intro.net
Introduction to ,NET Framework
Microsoft .NET Framework
Microsoft.Net
Microsoft .NET (dotnet) Framework 2003 - 2004 overview and web services…
.Net framework
Dotnet framework
Nakov dot net-framework-overview-english
Modified.net overview
Introduction to .NET by QuontraSolutions
Presentation1
Visual studio.net
.net framework
Introduction To Dotnet
Introduction to C#
As Pdotnet
Inside .net framework
SynapseIndia dotnet web development architecture module
Ad

More from Svetlin Nakov (20)

PPTX
AI and the Future of Devs: Nakov @ Techniverse (Nov 2024)
PPTX
AI за ежедневието - Наков @ Techniverse (Nov 2024)
PPTX
AI инструменти за бизнеса - Наков - Nov 2024
PPTX
AI Adoption in Business - Nakov at Forbes HR Forum - Sept 2024
PPTX
Software Engineers in the AI Era - Sept 2024
PPTX
Най-търсените направления в ИТ сферата за 2024
PPTX
BG-IT-Edu: отворено учебно съдържание за ИТ учители
PPTX
Programming World in 2024
PDF
AI Tools for Business and Startups
PPTX
AI Tools for Scientists - Nakov (Oct 2023)
PPTX
AI Tools for Entrepreneurs
PPTX
Bulgarian Tech Industry - Nakov at Dev.BG All in One Conference 2023
PPTX
AI Tools for Business and Personal Life
PDF
Дипломна работа: учебно съдържание по ООП - Светлин Наков
PPTX
Дипломна работа: учебно съдържание по ООП
PPTX
Свободно ИТ учебно съдържание за учители по програмиране и ИТ
PPTX
AI and the Professions of the Future
PPTX
Programming Languages Trends for 2023
PPTX
IT Professions and How to Become a Developer
PPTX
GitHub Actions (Nakov at RuseConf, Sept 2022)
AI and the Future of Devs: Nakov @ Techniverse (Nov 2024)
AI за ежедневието - Наков @ Techniverse (Nov 2024)
AI инструменти за бизнеса - Наков - Nov 2024
AI Adoption in Business - Nakov at Forbes HR Forum - Sept 2024
Software Engineers in the AI Era - Sept 2024
Най-търсените направления в ИТ сферата за 2024
BG-IT-Edu: отворено учебно съдържание за ИТ учители
Programming World in 2024
AI Tools for Business and Startups
AI Tools for Scientists - Nakov (Oct 2023)
AI Tools for Entrepreneurs
Bulgarian Tech Industry - Nakov at Dev.BG All in One Conference 2023
AI Tools for Business and Personal Life
Дипломна работа: учебно съдържание по ООП - Светлин Наков
Дипломна работа: учебно съдържание по ООП
Свободно ИТ учебно съдържание за учители по програмиране и ИТ
AI and the Professions of the Future
Programming Languages Trends for 2023
IT Professions and How to Become a Developer
GitHub Actions (Nakov at RuseConf, Sept 2022)

Recently uploaded (20)

PDF
Elevate Cleaning Efficiency Using Tallfly Hair Remover Roller Factory Expertise
PPTX
The Marketing Journey - Tracey Phillips - Marketing Matters 7-2025.pptx
PDF
Unit 1 Cost Accounting - Cost sheet
PDF
Katrina Stoneking: Shaking Up the Alcohol Beverage Industry
DOCX
Euro SEO Services 1st 3 General Updates.docx
PPT
Chapter four Project-Preparation material
PDF
Dr. Enrique Segura Ense Group - A Self-Made Entrepreneur And Executive
PDF
Types of control:Qualitative vs Quantitative
PPTX
Probability Distribution, binomial distribution, poisson distribution
PDF
COST SHEET- Tender and Quotation unit 2.pdf
PPTX
ICG2025_ICG 6th steering committee 30-8-24.pptx
PDF
Lecture 3 - Risk Management and Compliance.pdf
PDF
pdfcoffee.com-opt-b1plus-sb-answers.pdfvi
PPTX
DMT - Profile Brief About Business .pptx
PDF
Chapter 5_Foreign Exchange Market in .pdf
PDF
Hindu Circuler Economy - Model (Concept)
PPTX
AI-assistance in Knowledge Collection and Curation supporting Safe and Sustai...
PDF
MSPs in 10 Words - Created by US MSP Network
PDF
kom-180-proposal-for-a-directive-amending-directive-2014-45-eu-and-directive-...
DOCX
unit 1 COST ACCOUNTING AND COST SHEET
Elevate Cleaning Efficiency Using Tallfly Hair Remover Roller Factory Expertise
The Marketing Journey - Tracey Phillips - Marketing Matters 7-2025.pptx
Unit 1 Cost Accounting - Cost sheet
Katrina Stoneking: Shaking Up the Alcohol Beverage Industry
Euro SEO Services 1st 3 General Updates.docx
Chapter four Project-Preparation material
Dr. Enrique Segura Ense Group - A Self-Made Entrepreneur And Executive
Types of control:Qualitative vs Quantitative
Probability Distribution, binomial distribution, poisson distribution
COST SHEET- Tender and Quotation unit 2.pdf
ICG2025_ICG 6th steering committee 30-8-24.pptx
Lecture 3 - Risk Management and Compliance.pdf
pdfcoffee.com-opt-b1plus-sb-answers.pdfvi
DMT - Profile Brief About Business .pptx
Chapter 5_Foreign Exchange Market in .pdf
Hindu Circuler Economy - Model (Concept)
AI-assistance in Knowledge Collection and Curation supporting Safe and Sustai...
MSPs in 10 Words - Created by US MSP Network
kom-180-proposal-for-a-directive-amending-directive-2014-45-eu-and-directive-...
unit 1 COST ACCOUNTING AND COST SHEET

Nakov - .NET Framework Overview - English

  • 1.  
  • 2. Microsoft .NET Framework Overview Svetlin Nakov Software Development Consultant, Part-time Computer Science Lecturer Sofia University “St. Kliment Ohridski” http:// www.nakov.com
  • 3. .NET Enterprise Vision ERP & Billing Customer Service Sales Users Any device, Any place, Any time XML Web Services Integrate business applications and processes Back Office Heterogeneous application and server infrastructure Scheduling Authentication Notification
  • 4. So what is .NET? .NET is a platform that provides a standardized set of services. It’s just like Windows, except distributed over the Internet. It exports a common interface so that it’s programs can be run on any system that supports .NET. A specific software framework Includes a common runtime
  • 5. .NET Framework Programming model for .NET Platform for running .NET managed code in a virtual machine Provides a very good environment to develop networked applications and Web Services Provides programming API and unified language-independent development framework
  • 6. The Core of .NET Framework: FCL & CLR Common Language Runtime Garbage collection Language integration Multiple versioning support (no more DLL hell!) Integrated security Framework Class Library Provides the core functionality: ASP.NET, Web Services, ADO.NET, Windows Forms, IO, XML, etc.
  • 7. .NET Framework Common Language Runtime CLR manages code execution at runtime Memory management, thread management, etc. Operating System Common Language Runtime
  • 8. .NET Framework Base Class Library Object-oriented collection of reusable types Collections, I/O, Strings, … Operating System Common Language Runtime .NET Framework (Base Class Library)
  • 9. .NET Framework Data Access Layer Access relational databases Disconnected data model Work with XML Operating System Common Language Runtime .NET Framework (Base Class Library) ADO .NET and XML
  • 10. .NET Framework ASP.NET & Windows Forms Create application’s front-end – Web-based user interface, Windows GUI, Web services, … Operating System Common Language Runtime .NET Framework (Base Class Library) ADO .NET and XML ASP .NET Web Forms Web Services Mobile Internet Toolkit Windows Forms
  • 11. .NET Framework Programming Languages Use your favorite language Operating System Common Language Runtime C++ C# VB.NET Perl J# … .NET Framework (Base Class Library) ADO .NET and XML ASP .NET Web Forms Web Services Mobile Internet Toolkit Windows Forms
  • 12. .NET Framework Common Language Specification Operating System Common Language Runtime Common Language Specification .NET Framework (Base Class Library) ADO .NET and XML ASP .NET Web Forms Web Services Mobile Internet Toolkit Windows Forms C++ C# VB Perl J# …
  • 13. .NET Framework Visual Studio .NET Operating System Common Language Runtime Common Language Specification C++ C# VB Perl J# … Visual Studio .NET .NET Framework (Base Class Library) ADO .NET and XML ASP .NET Web Forms Web Services Mobile Internet Toolkit Windows Forms
  • 14. .NET Framework Standards Compliance Operating System Common Language Runtime Common Language Specification C++ C# VB Perl J# … Visual Studio .NET .NET Framework (Base Class Library) ADO .NET and XML ASP .NET Web Services Web Forms Mobile Internet Toolkit Windows Forms Open Language Specification C# Language – Submitted to ECMA XML-based data access Web services – XML, SOAP-based
  • 15. Common Language Runtime Manages running code – like a virtual machine Threading Memory management No interpreter: JIT-compiler produces native code – during the program installation or at run time Fine-grained evidence-based security Code access security Code can be verified to guarantee type safety No unsafe casts, no un-initialized variables and no out-of-bounds array indexing Role-based security
  • 16. Managed Code Code that targets the CLR is referred to as managed code All managed code has the features of the CLR Object-oriented Type-safe Cross-language integration Cross language exception handling Multiple version support Managed code is represented in special Intermediate Language (IL)
  • 17. Automatic Memory Management The CLR manages memory for managed code All allocations of objects and buffers made from a Managed Heap Unused objects and buffers are cleaned up automatically through Garbage Collection Some of the worst bugs in software development are not possible with managed code Leaked memory or objects References to freed or non-existent objects Reading of uninitialised variables Pointerless environment
  • 18. Multiple Language Support IL (MSIL or CIL) – Intermediate Language It is low-level (machine) language, like Assembler, but is Object-oriented CTS is a rich type system built into the CLR Implements various types ( int , float, string, …) And operations on those types CLS is a set of specifications that all languages and libraries need to follow This will ensure interoperability between languages
  • 19. Intermediate Language .NET languages are compiled to an Intermediate Language (IL) IL is also known as MSIL or CIL CLR compiles IL in just-in-time (JIT) manner – each function is compiled just before execution The JIT code stays in memory for subsequent calls Recompilations of assemblies are also possible
  • 20. Example of MSIL Code .method private hidebysig static void Main() cil managed { .entrypoint // Code size 11 (0xb) .maxstack 8 IL_0000: ldstr &quot;Hello, world!&quot; IL_0005: call void [mscorlib]System.Console::WriteLine(string) IL_000a: ret } // end of method HelloWorld::Main
  • 21. Common Type System (CTS) All .NET languages have the same primitive data types. An int in C# is the same as an int in VB.NET When communicating between modules written in any .NET language, the types are guaranteed to be compatible on the binary level Types can be: Value types – passed by value, stored in the stack Reference types – passed by reference, stored in the heap Strings are a primitive data type now
  • 22. Common Language Specification (CLS) Any language that conforms to the CLS is a .NET language A language that conforms to the CLS has the ability to take full advantage of the Framework Class Library (FCL) CLS is standardized by ECMA
  • 23. .NET Languages Languages provided by Microsoft C++, C#, J#, VB.NET, JScript Third-parties languages Perl, Python, Pascal, APL, COBOL, Eiffel, Haskell, ML, Oberon, Scheme, Smalltalk… Advanced multi-language features Cross-language inheritance and exceptions handling Object system is built in, not bolted on No additional rules or API to learn
  • 24. C# Language Mixture between C++, Java and Delphi Component-oriented Properties, Methods, Events Attributes, XML documentation All in one place, no header files, IDL, etc. Can be embedded in ASP+ pages Everything really is an object Primitive types aren’t magic Unified type system == Deep simplicity Improved extensibility and reusability
  • 25. C# Language – Example using System; class HelloWorld { public static void main() { Console.WriteLine(“Hello, world!”); } }
  • 26. Code Compilation and Execution Compilation Before installation or the first time each method is called Execution Also called Assembly (.EXE or .DLL file) JIT Compiler Native Code MSIL Code Metadata Source Code Language Compiler
  • 27. Assemblies DLL or EXE file Smallest deployable unit in the CLR Have unique version number No version conflicts (known as DLL hell) Contains IL code to be executed Security boundary – permissions are granted at the assembly level Type boundary – all types include the assembly name they are a part of Self-describing manifest – metadata that describes the types in the assembly
  • 28. Metadata in Assembly Type Descriptions Classes Base classes Implemented interfaces Data members Methods Name Version Culture Assembly Description Other assemblies Security Permissions Exported Types
  • 29. Applications One or more assemblies Assemblies conflict resolution Using metadata Local (preferred) Global Assembly Cache (GAC) Different applications may use different versions of an assembly Easier software updates Easier software removal
  • 30. Visual Studio .NET Development tool that contains a rich set of productivity and debugging features Supports managed and unmanaged applications Supports C#, C++, VB.NET, … Many useful tools and wizards Windows Forms Designer ASP.NET Web Forms Designer Web Services support SQL Server integration with ADO.NET and XML VS.NET is not part of the .NET Framework Not necessary to build or run managed code The .NET Framework SDK includes command line compilers
  • 31. VS.NET – Single Development Environment & Skill Set From Visual Studio.NET you can: Write code Design user interface Study documentation Debug Test Deploy Same tools for all languages Same tools for all platforms
  • 33. The .NET Framework Library Base Class Library ADO.NET and XML Web Forms Web Services Mobile Internet Toolkit Windows Forms ASP.NET
  • 34. .NET Framework Namespaces System Globalization Diagnostics Configuration Collections Resources Reflection Net IO Threading Text ServiceProcess Security Runtime InteropServices Remoting Serialization System.Data Design ADO SQLTypes SQL System.Xml XPath XSLT Serialization System.Web Configuration SessionState Caching Security Services UI HtmlControls WebControls Description Discovery Protocols System.Drawing Imaging Drawing2D Text Printing System.WinForms Design ComponentModel
  • 35. Base Class Library Namespaces System Threading Text ServiceProcess Security Resources Reflection Net IO Globalization Diagnostics Configuration Collections Runtime Serialization Remoting InteropServices
  • 36. Base Class Library Data types, conversions, formatting Collections: ArrayList, Hashtable , etc. Globalization: Cultures, sorting, etc. I/O: Binary and text streams, files, etc. Networking: HTTP, TCP/IP sockets, etc. Reflection: Metadata and IL emit Security: Permissions, cryptography Text: Encodings, regular expressions
  • 37. Data And XML Namespaces System.Data SQLTypes SQLClient Common OleDb System.Xml Serialization XPath XSLT
  • 38. ADO.NET And XML ADO.NET consumes all types of data XML (hierarchical), relational, etc. Powerful in-memory data cache (DataSet) DataSet contains various data objects: tables, views, relations, constraints, etc. Lightweight, stateless, disconnected Supports both relational and XML access High-performance, low overhead stream access Great XML support including: W3C DOM, XSL/T, XPath, and Schema
  • 39. VS.NET – DataSet Designer
  • 40. Windows Forms Namespaces System.Drawing Drawing2D Imaging Printing Text System.Windows.Forms Design ComponentModel
  • 41. Windows Forms Windows Forms is framework for building rich GUI applications RAD (Rapid Application Development) component-based event-driven Rich set of controls Data aware components ActiveX® Support Printing support Unicode support UI inheritance
  • 42. Windows Forms Combines VB and Delphi forms with the power of MFC Delegation as well as subclassing Advanced features Visual forms inheritance, automatic layout Advanced graphics support – GDI+ Easy access to Win32 ® API Controls can be hosted in IE 5.x No installation, registration or GUIDs Code access security
  • 43. VS.NET – Windows Forms Designer
  • 44. Demo Create simple database application with: Windows Forms ADO.NET MS SQL Server Visual Studio .NET
  • 45. ASP.NET Namespaces System.Web Caching Configuration Services UI SessionState HtmlControls WebControls Description Discovery Security Protocols
  • 46. Framework for building Web applications and Web services in any .NET language C#, C++, VB.NET, JScript , etc. Automatic multiple clients support DHTML, HTML 3.2, WML, small devices Compilation of ASP.NET Web applications into .NET assemblies Cached the first time when called All subsequent calls use the cached version Separation of code and content Developers and designers can work independently ASP.NET
  • 47. ASP.NET Rich page architecture – “Web Forms” Rich set of ASP.NET server controls Data validation Data bound grids Event-driven execution model Great Web-services support Easy to deploy High reliability and availability High performance and scalability Scalable handling of state information
  • 48. VS.NET – Web Forms Designer
  • 49. Demo Create simple Web-based database application with: ASP.NET (Web Forms) ADO.NET MS SQL Server Visual Studio .NET
  • 50. Web Services Technical definition – “A programmable application component accessible via standard Web protocols” Built on XML and SOAP Expose functionality from Web Sites Almost like component programming over the Web Functionality exposed using XML/HTML Standard Web Services include Calendar MSN Passport
  • 51. XML Web Services Foundation Simple, Open, Broad Industry Support Open standards: Ubiquitous Communications: Internet Universal Data Format: XML Service Interactions: SOAP Publish, Find, Use Services: UDDI
  • 52. ASP.NET Web Services Simple programming model Author .ASMX files with class methods ASP.NET compiles on demand, generates WSDL contract, exposes HTML test page Incoming HTTP/SOAP messages invoke methods No special HTTP, SOAP or XML knowledge required Supports multiple message wire formats HTTP GET, POST, and SOAP Requests
  • 53. Web Service Example in C# ParcelTracker.asmx <%@ WebService Language=&quot;C#&quot; %> using System; using System.Web.Services; public class ParcelTrackerWebService { [WebMethod] public string GetOrderStatus(int orderNumber) { // Implementation here } }
  • 54. .NET Framework on Linux Mono Project Open Source C# compiler, CLR and Framework Class Library Runs on various platforms and hardware: Linux, Unix, FreeBSD, Windows – JIT-compiler for x86 s390, SPARC , PowerPC – interpreter for these hardware architectures Supports also: ADO.NET and XML Windows Forms (not fully) ASP.NET Web Services
  • 55. .NET Framework on Linux (2) Mono Project Runs .NET portable executables on Linux, e.g. mono myapp.exe Compiles .NET applications to portable executables, e.g. mcs myapp.cs The obtained .exe file can taken and run on Windows DotGNU Portable.NET Build and execute .NET applications on GNU/Linux , Windows, Solaris, NetBSD, FreeBSD, and MacOS X
  • 56. Summary .NET Framework is a code execution platform – the environment which .NET programs run .NET Framework consists of two primary parts: Common Language Runtime and .NET Class Libraries The CLS (Common Language Specification) allows different languages to interact seamlessly. The CTS (Common Type System) allows all languages to share base data types.
  • 57. Summary (2) .NET languages are compiled to MSIL by their respective compilers MSIL code is compiled to machine code by the JIT compiler All .NET languages have equal access to the FCL (Framework Class Library) which is a rich set of classes for developing software Base Class Library is set of basic classes: Collections, I/O, Networking, Security, etc. ADO.NET provides .NET applications with access to relational databases
  • 58. Summary (3) .NET has great XML support including: DOM, XSLT, XPath , and XSchema Windows Forms provides GUI interface for the .NET applications ASP.NET allows creating web interface to .NET applications Web Services expose functionality from web sites and make it remotely accessible through standard XML-based protocols Visual Studio .NET is powerful development IDE for all .NET languages and technologies
  • 59. .NET Framework – Resources Visit following web sites: . NET Framework Home Site – http://msdn.microsoft.com/netframework/ The Microsoft .NET Framework Community – http://www.gotdotnet.com/ ASP.NET – http://www.asp.net/ .NET Windows Forms – http://www.windowsforms.net/ Code Project – http://www.codeproject.net/ Mono – Open Source .NET Framework – http://www.go-mono.org/ Rotor – Shared Source .NET CLI – http://msdn.microsoft.com/net/sscli/ Read the news groups: news:// msnews.microsoft.com / microsoft.public.dotnet.framework