Understanding .NET Technology Architecture

Slide Note
Embed
Share

.NET Technology is a versatile platform for developing desktop, web, and mobile applications. It provides a comprehensive framework for building unmanaged and managed applications, along with services like web forms, web services, and common language runtime. With a focus on interoperability and a uniform model for programming different types of applications, .NET offers a powerful environment for developers to create robust software solutions.


Uploaded on Sep 28, 2024 | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. Download presentation by click this link. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

E N D

Presentation Transcript


  1. INTRODUCTION BASED ON SLIDES OF: PROF. DR. HANSPETER M SSENB CK INSTITUTE FOR SYSTEM SOFTWARE JOHANNES KEPLER UNIVERSITY LINZ Architecture of the .NET Technology Jan Janou ek, FEI - Katedra Informatiky

  2. What is .NET? 2 A software platform for the desktop and the Web Unmanaged Applications Operating System (Windows, Linux, Unix, ...)

  3. What is .NET? 3 A software platform for the desktop and the Web Unmanaged Applications Managed Applications Class Library Common Language Runtime Operating System (Windows, Linux, Unix, ...) Common Language Runtime interoperability, security, garbage collection, versioning, ... Class Library GUI, collections, threads, networking, reflection, XML, ...

  4. What is .NET? 4 A software platform for the desktop and the Web Unmanaged Applications Managed Applications Web Applications Web Forms Web Services Class Library ASP.NET Common Language Runtime Web Server (IIS) Operating System (Windows, Linux, Unix, ...) ASP.NET, Web Forms Web GUI (object-oriented, event-based, browser-independent) Web Services distributed services over RPC (SOAP, HTTP)

  5. What is .NET? 5 A framework and more ... Unmanaged Applications Managed Applications Web Applications Web Forms Web Services Class Library ASP.NET Common Language Runtime Web Server (IIS) Operating System (Windows, Linux, Unix, ...) .NET Framework

  6. Goals of .NET 6 Uniform model for desktop Web and mobile programming So far Desktop programming Web programming object-oriented compiled (C/C++, Fortran, ...) extensive class libraries ASP (not object-oriented) interpreted (PHP, Javascript, ...) specialized libraries Under .NET Desktop and Web programming object-oriented (even ASP.NET) compiled (C#, C++, VB.NET, Fortran, ...) uniform class library

  7. Goals of .NET 7 Interoperability between programming languages So far - millions of lines of code in C++, Fortran, Visual Basic, ... - very limited interoperability Under .NET - binary compatibility between more than 20 languges (C#, C++, VB.NET, Java, Eiffel, Fortran, Cobol, ML, Haskell, Pascal, Oberon, Perl, Python, ...) class in VB.NET subclass in C# used in Eiffel Public Class A Public x As Integer Public Sub Foo() ... End Class class B : A { public string s; public void Bar() {...} } class Client feature obj: B; ... create obj; obj.Bar; ... end

  8. Interoperability 8 C# if (a > b) max = a; else max = b; C# C++ VB ... CIL compiler compiler compiler compiler IL_0004: ldloc.0 IL_0005: ldloc.1 IL_0006: ble.s IL_000c IL_0008: ldloc.0 IL_0009: stloc.2 IL_000a: br.s IL_000e IL_000c: ldloc.1 IL_000d: stloc.2 CIL code (+ metadata) loader Intel code verifier mov ebx,[-4] mov edx,[-8] cmp ebx,edx jle 17 mov ebx,[-4] mov [-12],ebx ... JIT compiler machine code

  9. Goals of .NET 9 More quality and convenience - Security strong static typing run-time type checks (no more buffer overruns!) garbage collection CIL code verifier public key signatures of code role-based access rights code-based access rights - Side by Side Execution versioning end of "DLL hell" - Simpler Software Installation no more registry entries clean and simple de-installation

  10. Assemblies 10 Prog.cs Lib.cs Assemblies are the smallest unit for deployment versioning dynamic loading class A { ... } class B { ... } class C { ... } csc Prog.cs,Lib.cs Prog.exe version number public key interface description of - classes - methods - variables - parameters - types - ... manifest metadata is used for: - dynamic loading - versioning - reflection metadata CIL code of A CIL code of B CIL code of C loader

  11. CLI - Common Language Infrastructure 11 CLI defines the basic platform for the .NET architecture described by ECMA Standard 335 http://www.ecma-international.org/publications/standards/ecma-335.htm Microsoft's .NET Framework contains Common Language Runtime (CLR) = Microsoft's implementation of the CLI standard completely fulfills the standard and offers still more, e.g. ASP.NET ADO.NET Web Services extended class library ...

  12. CLI Features 12 CIL CTS Assembly Metadata common intermediate language common type system special deployment unit extensible type information integration of many programming languages (Common Language Specification) code-based security model automatic memory management just-in-time compilation (NEVER interpretation!) Virtual Execution System CLS CAS GC JIT VES

  13. Architecture of the CLR 13 What is a virtual machine (VM)? programs (Z#, C#, C++, ...) a CPU implemented in Software other examples: Java-VM, Smalltalk-VM, Pascal P-Code CLR e.g. Intel processor The CLR is a stack machine no registers instead it has an expression stack (onto which values are loaded) estack max. size is stored in metadata of each method esp esp ... expression stack pointer The CLR executes JIT-compiled bytecode each method is compiled right before the first execution (= just-in-time) operands are addressed symbolically in IL (informationen is stored in the metadata)

  14. Advantages of a Virtual Machine 14 portability (platform and language independence) w/o VM: compilers for each language on each platform C# VB.NET Oberon Eiffel e.g. 4 4 = 16 Windows MacOS Linux PalmOS w/ VM: translation into intermediate language (with .NET: CIL) one compiler per language and one CLR (JIT compiler) per platform C# VB.NET Oberon Eiffel CIL e.g. 4 + 4 = 8 Windows MacOS Linux PalmOS ... compiler compactness of intermediate code better optimizations for native code at JIT compile time

  15. Example: Hello, .NET-World! 15 HelloWorld.cs: class HelloWorldApp { static void Main () { System.Console.WriteLine("Hello, .NET-World!"); } } Compile and create assembly (w/ C# compiler): > csc HelloWorld.cs Assembly: HelloWorld.exe (3072 Byte!)

  16. CIL and Metadata 16 IL assembler code (= Metadata + CIL) of method Main: .method private hidebysig static void Main() cil managed { .entrypoint .maxstack 1 ldstr "Hello, .NET-World!" call void [mscorlib]System.Console::WriteLine(string) ret } manifest of HelloWorld.exe: .assembly extern mscorlib { .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) .ver 1:0:3300:0 } .assembly HelloWorld { .hash algorithm 0x00008004 .ver 0:0:0:0 } .module HelloWorld.exe

Related