Beginners Net Framework

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Favorites, Groups & Events

    Beginners Net Framework - Presentation Transcript

    1. .NET Framework
      • Part I
    2. What is .NET Framework?
      • The .NET Framework is an integral Windows component for building and running the next generation of software applications and Web services.
    3. Common Language Runtime
      • This is the execution engine.
      • It loads and executes all the .net code.
      • This is similar to JVM.
    4. Base class libraries
      • These are set of classes provided by Microsoft.
      • These classes help developers to improve productivity by using their methods.
      • These classes are physically grouped into dll’s.
      • These classes are logically grouped into namespaces.
    5. CTS
      • The programmers can write their code in any of the following programming languages C#, VB.NET, VC++, J# etc.
      • These programming languages when compiled yield a dll or exe file. The content in this file is called as MSIL – Microsoft Intermediate Language.
      • The MSIL will be almost same when you compile a program written in c# and the same program written in vb.net or other .net languages.
      • The code that runs in .NET environment is called as managed code.
      • Common type system is a standard that all the programming languages should implement so that a code written in c# can interact with a code written in vb.net or other .net languages.
      • The common types system enables interoperability between the .net applications.
      • All the programs are classes in .NET.
    6. Compilation and Execution of .NET Code
      • The code written in .net programming language is compiled to MSIL – Microsoft Intermediate Language and a dll or exe file is produced.
      • The dll or exe when needed by an application will be first loaded by the operating system.
      • The operating system checks if the file is .net executable or win32 executable by checking the first few bytes of the dll.
      • If it is .net dll or exe then the operating system calls a function in mscorlib.dll. This is the core file of .NET framework.
      • The function in the mscorlib.dll copies the dll or exe content into managed memory.
      • A managed memory is nothing but a separate address space allocated to .NET framework to execute .net code.
    7. Compilation and Execution of .NET Code…
      • Once the code is copied to the managed area then the method which is to be executed will be checked for access rights and security permissions and then checked if it is type safe and compiled from MSIL to native machine language.
      • This activity is called JIT compilation.
      • The JIT compilation happens at method level and not at class level.
      • Once the code is compiled to native machine language then the code will execute by using the classes present in the base class framework.
    8. Advantages of .NET Framework
      • There is no need to register any dll’s developed in .net.
      • Increases developers productivity by providing reusable classes in base class framework library.
      • The code is now machine independent and hence it can work on any hardware architecture provided the JIT compiler is able to emit machine language for that target hardware.
    9. Advantages of .NET Framework …
      • It provides sophisticated facilities for debugging.
      • It provides high interoperability.
      • The .net code written in VB.NET can work seamlessly with C#. This is all possible because of common type system.
      • Very good memory management features.
      • Garbage collection is provided by .net framework that collects all the unused objects in the .net memory called memory heap or managed memory.
      • The interaction with database from .net environment is highly stable and huge volume of data can now be moved into .net memory heap without crashing any applications.
      • .NET framework 2.0 provides generics which is similar to C++ and it improves reusability highly.
      • 64-Bit edition of .NET framework is also available now and it is called as WOW64-Windows on Windows 64.
      • Most of the managed code is type safe which means that it accesses memory only allocated to it and hence the users don’t get illegal reference errors.
      • The verification process also checks if the code is type safe before JIT compilation.
      • Side by Side execution – two version of same class developed in .net can be in the machine and execute seamlessly.
    10. Types of applications in .NET
      • Console application – These type of applications have a dos like user interface. You cannot have controls like button there.
      • Windows application – These type of applications have sophisticated User Interface and it runs in local machine.
      • Windows service – These are batch like application which don’t have an User Interface mostly but can have a User Interface by obtaining a handle to desktop. This application can be started and stopped through control panel  administrative tools  services.
      • Web application – These are hosted on a web server like Microsoft Internet Information Services. These are called as ASP.NET applications. The user access it using the browser.
      • Web service – These are also web applications hosted on a web server like Microsoft Internet Information Services. These are called as ASP.NET web services. These applications expose a method of a class on the web and users can use it. The web services can be referenced by web applications in both client side and server side and windows applications can also reference the same. This is used to hide the business logic from the consumers.
      • Mobile applications – These applications run on .NET compact framework installed on windows mobile operating systems. Handhelds and PDA’s use this type of framework and the application.
    11. Assembly
      • Any output in .net framework is called as assembly.
      • The assembly consists of intermediate language code with a rich set of meta data.
      • The JIT compiler uses the meta data and MSIL code in the dll or exe to produce native machine language code.
      • Whenever a class is loaded it is compiled into native machine language. This may be a overhead for real time applications. To overcome this the developer can convert the .net dll or exe to native language and use that all times. This can be achieved using a tool called ngen.exe. This tool accepts a .net dll or exe and converts it into native machine language dll or exe.
      • Note that even if a code is converted into machine language it still needs library in .net framework for execution.
      • When you try to load the class, the .net framework service checks if the class is present in the same directory as that of the application. If it is not present there it check GLOBAL ASSEMBLY cache. This directory is present in C:WINDOWSassembly directory. If you make your assembly move to global assembly cache you can run gacutil.exe tool in .net framework.
      • Assemblies when converted into native language will contain the following segments data segment, code segment and stack segment.
      • If multiple instances of the assembly are needed the data segment and stack segment are cloned and the code segment is shared across instances to reduce the usage of memory.
    12. Application Domains
      • The operating system uses the following constructs to execute a code.
        • Thread
        • Process.
      • A process is a program plus the set of resources needed for its execution
      • Each process will be allocated a finite number of threads to execute the code.
      • Mostly code that can run independently will be spawned off to a new thread under the process.
      • In .NET framework a middle layer is introduced between process and threads. This is called application domain.
      • An application domain will have a finite set of threads and a collection of programs.
      • The main benefit of application domain is that it reuses the threads allocated by the operating system across different programs. It also defines a neat boundary in execution of a program. The threads are effectively utilized by .net framework.
      • The application domains also share the assemblies across the programs. These type of assemblies are called domain neutral assemblies.
    13. Application Domain…
      • Every assembly must be loaded within an application domain before it is executed.
      • Mscorlib assembly in .net is always loaded as domain neutral assembly.
      • The domain level security policy set by users on the system govern sharing of assemblies.
    14. How ASP.NET applications work with IIS?
      • Every ASP.NET application should be hosted on an web server.
      • When a user types the url of the asp.net application in his browser and hits enter then the request is first sent to the web server. This request is sent using HTTP –Hyper Text Transfer Protocol.
      • The web server then checks the request type and find the associated application type.
      • If the request is from ASPX page then the web server will redirect all the requests to .NET framework. To do that the users must have registered ASP.NET dlls with IIS.
      • The registration of ASP.NET dll is done by running the utility ASPNET_REGIIS –I.
      • Once the aspnet_isapi.dll is registered with IIS, the iis calls a function in aspnet_isapi.dll. This function first checks if the worker process is running in the server. The worker process is ASPNET_WP.EXE. If the worker process is not running the aspnet_isapi.dll will load it and start the application. This can be checked by seeing this process in task manager.
      • The worker process uses a special account called ASPNET user to access all the resources needed for it like files, class etc.
      • The request from IIS is now redirected to aspnet_wp.exe. This file load the classes in SYSTEM.WEB.HOSTING namespace and uses it and give the output to worker process and then the worker process gives it to IIS and then it is passed on to clients.
    15. To be continued…
    SlideShare Zeitgeist 2009

    + Thirukkumaran HaridassThirukkumaran Haridass Nominate

    custom

    341 views, 0 favs, 3 embeds more stats

    Beginners .NET Framework

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 341
      • 321 on SlideShare
      • 20 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 0
    Most viewed embeds
    • 13 views on http://www.emrekiyak.com
    • 6 views on http://creagx.net
    • 1 views on http://emrekiyak.com

    more

    All embeds
    • 13 views on http://www.emrekiyak.com
    • 6 views on http://creagx.net
    • 1 views on http://emrekiyak.com

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories

    Tags