Introduction to .net


Published on

Published in: Education, Technology
1 Comment
  • this side is best
    i am from srilanka
    my email is
    my contect is +94752388962
    Are you sure you want to  Yes  No
    Your message goes here
  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Introduction to .net

  1. 1. Introduction to .NET
  3. 3. <ul><li>Computer programs were written using procedural languages .(C, Cobol, Pascal, etc.) </li></ul><ul><ul><li>Code was written around functions; i.e., logic is built around the functions to be performed. </li></ul></ul><ul><li>Object Oriented Programming (OOP) era ( C++ and Smalltalk). </li></ul><ul><ul><li>Code was written around data; i.e., logic is built by identifying the data in the system and performing functions around this data. </li></ul></ul>
  4. 4. Disadvantages <ul><li>The resources (like memory) were managed by the progra mmer and there was no runtime support provided by the programming language. </li></ul><ul><li>This caused a lot of problems by assigning programmers a lot of responsibilities, the mishandling of which could easily crash the whole application (and sometimes the Operating System (OS) itself). </li></ul>
  5. 5. Introduction of Java <ul><li>The first commercially successful language to provide such runtime support was Java by Sun Microsystems (although runtime support was present in languages like Smalltalk). </li></ul><ul><li>Java comes with a runtime environment, called Java Virtual Machine (JVM) which performs memory management, garbage collection, checking of runtime data types and memory access. </li></ul><ul><li>Java also presented the idea of 'Platform independence' by providing their JVM implementation for several OS and different hardware. This meant that a compiled java program can run on multiple OS and hardware without any change or re-compilation (at least in theory). </li></ul>
  6. 6. <ul><li>Drastic changes in other popular concepts- </li></ul><ul><ul><li>Eliminating Pointers, Multiple inheritance, Operator overloading and Templates. </li></ul></ul><ul><li>Java a very popular language </li></ul><ul><ul><li>For both academic and development environments, especially web applications. </li></ul></ul><ul><li>Java provides this ease and simplification at the penalty of performance by introducing interpreter at runtime. </li></ul><ul><li>Disadvantage: Also, because of the platform independence of Java, it lacks in some Platform specific features such as GUI and event handling. </li></ul>
  7. 7. History of .NET <ul><li>In the beginning of 1998, a team of developers at Microsoft had just finished work on a new version of IIS 4.0 including several new features in ASP </li></ul><ul><li>While developers were pleased to see new capabilities for internet development on WinNT they developed a new architecture called NGWS (next Generation windows services) </li></ul><ul><li>In July 2000 ,Microsoft held a professional Developers conference (PDC) in Orlando, Florida. </li></ul><ul><ul><ul><li>Next Generation Platform for windows and Internet Software Development (.NET) </li></ul></ul></ul>
  8. 8. Microsoft .Net <ul><li>In the year 2000, Microsoft launched its new development environment called Microsoft Visual Studio .Net. </li></ul><ul><li>Microsoft .Net, at its core, is very similar to J2EE (Java 2 Enterprise Edition). </li></ul><ul><li>But, .Net is a compromise between traditional 'un-managed' and 'managed' style of programming. </li></ul><ul><li>It allows a programmer to run both managed (code managed by .Net Runtime) and un-managed code (not managed by .Net runtime). </li></ul><ul><li>In managed code, .Net does memory management, run-time type checking, memory access checking and exception handling on behalf of your program. </li></ul>
  9. 9. <ul><li>It’s the framework for the .Net platform. </li></ul><ul><li>Its a common environment for building, deploying, and running Web applications and Web Services. </li></ul><ul><li>It consists of the following </li></ul><ul><ul><li>CLR (Common Language Runtime) </li></ul></ul><ul><ul><li>CTS (Common Type System) </li></ul></ul><ul><ul><li>Common Class Libraries. </li></ul></ul><ul><li>The .Net Framework provides the following. </li></ul><ul><ul><li>Rich Application Environment </li></ul></ul><ul><ul><li>Simplified Development </li></ul></ul><ul><ul><li>Easy Integration </li></ul></ul><ul><li>The .Net is language neutral. </li></ul>Microsoft .NET
  10. 10. <ul><li>Microsoft Visual Studio.NET is the common development environment for the .NET Framework. </li></ul><ul><li>Its for providing powerful, reliable enterprise Web Solutions. </li></ul><ul><li>It’s a framework designed by Microsoft. </li></ul><ul><li>It has been written so that applications on other platforms will be able to access these services. </li></ul><ul><li>Its built upon open standard technologies like XML and SOAP </li></ul>Microsoft .NET
  11. 11. <ul><li>Microsoft .NET was originally called NGWS </li></ul><ul><li>It is a new Internet and web based architecture </li></ul><ul><li>.Net delivers software as Web Services </li></ul><ul><li>It is a Framework for universal services </li></ul><ul><li>It will run in any browser on any platform </li></ul><ul><li>It Contains Common Class Libraries like ADO.NET and ASP.NET and windows forms to provide advanced std services that can be integrated on variety of computer systems </li></ul>Microsoft .NET
  12. 12. <ul><li>.Net uses Just In Time (JIT) compilers to translate your intermediate compiled code to native executable code, which significantly improves the performance. </li></ul><ul><li>.Net also provides 'Platform independence' and 'Language Independence'. However, the concept of 'Platform independence' is somewhat different from Java. </li></ul><ul><li>In .Net, your compiled program can run on any hardware running any variant of the Windows OS (except for Windows 95). </li></ul>Microsoft .NET
  13. 13. Microsoft .NET <ul><li>.Net also provides cross language support. This means that modules written in different .Net compliant languages can call/use each others modules. Hence, it is possible to write your class in C#, inherit it in VB.Net and finally use it in VC++.Net </li></ul><ul><li>There are as many as 22 languages supporting the .Net Platform (including C#, VB, C++, J#, Cobol, Eiffel, Pascal, Fortran, RPG, Smalltalk and others) and enjoying full use of the .Net runtime and huge Framework class library (FCL). </li></ul>
  14. 14. <ul><li>.Net is useful for building a variety of Windows applications, web applications and services, database and embedded applications (using .Net compact version). </li></ul><ul><li>On the marketing and commercial side, Microsoft is apparently putting 80% of its development resources and investment on .Net by providing a number of .Net enabled/supported applications like SQL server.Net and Windows Server 2003 </li></ul>Microsoft .NET
  15. 15. Internet Standards Of .NET <ul><li>HTTP – used as a Communication protocol between Internet Applications </li></ul><ul><li>XML – used to exchange the data between internet applications </li></ul><ul><li>SOAP – Used to request web services </li></ul><ul><li>UDDI – Used to search and discover Web </li></ul><ul><li>services </li></ul>
  16. 16. Web Services <ul><li>These are small units of code built to handle a limited task </li></ul><ul><li>These are XML based communicating protocols </li></ul><ul><li>These are independent of OS </li></ul><ul><li>These are independent of Programming Languages </li></ul><ul><li>These connect people , system and devices </li></ul>
  17. 17. .Net Architecture and .Net Framework <ul><li>In the .Net Architecture and the .Net Framework there are different important terms and concepts which we will discuss one by one:- </li></ul><ul><li>1) Common Language Runtime (CLR): 2) MSIL (Microsoft Intermediate Language) </li></ul><ul><li>3) Just In Time Compilers (JITers) </li></ul><ul><li>4) Framework Class Library (FCL) </li></ul><ul><li>5) Common Language Specification (CLS) </li></ul><ul><li>6) Common Type System (CTS) </li></ul><ul><li>7) Garbage Collector (GC) </li></ul><ul><li> </li></ul>
  18. 18. Common Language Runtime (CLR): <ul><li>The most important concept of the .Net Framework is the existence and functionality of the .Net Common Language Runtime (CLR), also called .Net Runtime in short. </li></ul><ul><li>It is a framework layer that resides above the OS and handles the execution of all the .Net applications. </li></ul><ul><li>Our programs don't directly communicate with the OS but go through the CLR. </li></ul>
  19. 19. MSIL (Microsoft Intermediate Language) Code: <ul><li>When we compile our .Net Program using any .Net compliant language (like C#, VB.Net, C++.Net) it does not get converted into the executable binary code but to an intermediate code, called MSIL or IL, understandable by CLR. </li></ul><ul><li>MSIL is OS and hardware independent code. </li></ul><ul><li>When the program needs to be executed, this MSIL, or intermediate code, is converted to binary executable code (native code). </li></ul><ul><li>The presence of IL makes possible the Cross Language Relationship as all the .Net compliant languages produce similar, standard IL code. </li></ul>
  20. 20. Working of CLR Code in any .net Language MSIL Code Executable Native Code Language Compiler At Compile Time Just In Time Compiler At Run Time
  21. 21. Just In Time Compilers (JITers) <ul><li>When our IL compiled code needs to be executed, CLR invokes the JIT compilers which compile the IL code to native executable code (.exe or .dll) that is designed for the specific machine and OS </li></ul><ul><li>JITers in many ways are different from traditional compilers as they compile the IL to native code only when desired; e.g., when a function is called, the IL of the function's body is converted to native code just in time . </li></ul><ul><li>So, the part of code that is not used by that particular run is never converted to native code. </li></ul>
  22. 22. <ul><li>If some IL code is converted to native code, then the next time it's needed, the CLR reuses the same (already compiled) copy without re-compiling. </li></ul><ul><li>So, if a program runs for sometime (assuming that all or most of the functions get called), then it won't have any just-in-time performance penalty. </li></ul><ul><li>As JITers are aware of the specific processor and OS at runtime, they can optimize the code extremely efficiently resulting in very robust applications. </li></ul>Just In Time Compilers (JITers)
  23. 23. <ul><li>Also, since a JIT compiler knows the exact current state of executable code, they can also optimize the code by in-lining small function calls (like replacing body of small function when its called in a loop, saving the function call time). </li></ul><ul><li>Although Microsoft stated that C# and .Net are not competing with languages like C++ in efficiency and speed of execution, JITers can make your code even faster than C++ code in some cases when the program is run over an extended period of time (like web-servers). </li></ul>Just In Time Compilers (JITers)
  24. 24. Types of JIT <ul><li>JIT </li></ul><ul><ul><li>This the default JIT compiler of the NGWS runtime. </li></ul></ul><ul><ul><li>It can cope up with unrestricted sets of IL instructions. </li></ul></ul><ul><ul><li>Its main constraint is the time it takes to perform the optimizations. </li></ul></ul><ul><li>EconoJIT </li></ul><ul><ul><li>It performs high speed conversion of IL to Managed native code. </li></ul></ul><ul><ul><li>It allows caching for generated native code. </li></ul></ul><ul><ul><li>It isn’t optimized as the code produced by the main JIT. </li></ul></ul><ul><li>PreJIT </li></ul><ul><ul><li>It works like the traditional compiler. </li></ul></ul><ul><ul><li>Its based on the main JIT Compiler. </li></ul></ul><ul><ul><li>It has faster loading time and faster application start time. </li></ul></ul>
  25. 25. Framework Class Library (FCL) <ul><li>The .Net Framework provides a huge Framework (or Base) Class Library (FCL) for common, usual tasks </li></ul><ul><li>FCL contains thousands of classes to provide access to Windows API and common functions like String Manipulation, Common Data Structures, IO, Streams, Threads, Security, Network Programming, Windows Programming, Web Programming, Data Access, etc. </li></ul><ul><li>It is simply the largest standard library ever shipped with any development environment or programming language. </li></ul>
  26. 26. <ul><li>The best part of this library is they follow extremely efficient OO design (design patterns) making their access and use very simple and predictable </li></ul><ul><li>You can use the classes in FCL in your program just as you would use any other class. You can even apply inheritance and polymorphism to these classes. </li></ul>Framework Class Library (FCL)
  27. 27. Common Language Specification (CLS) <ul><li>Microsoft has released a small set of specifications that each language should meet to qualify as a .Net Compliant Language </li></ul><ul><li>As IL is a very rich language, it is not necessary for a language to implement all the IL functionality; rather, it merely needs to meet a small subset of CLS to qualify as a .Net compliant language. </li></ul><ul><li>This is the reason why so many languages (procedural and OO) are now running under the .Net umbrella. </li></ul>
  28. 28. <ul><li>CLS basically addresses language design issues and lays down certain standards. </li></ul><ul><li>For instance, there shouldn't be any global function declarations, no pointers, no multiple inheritance and things like that. </li></ul><ul><li>The important point to note here is that if you keep your code within the CLS boundary, your code is guaranteed to be usable in any other .Net language. </li></ul>Common Language Specification (CLS)
  29. 29. Common Type System (CTS) <ul><li>.Net also defines a Common Type System (CTS). </li></ul><ul><li>Like CLS, CTS is also a set of standards. </li></ul><ul><li>CTS defines the basic data types that IL understands. </li></ul><ul><li>Each .Net com language should map its data types to these standard data types. This makes it possible for the 2 languages to communicate with each other by passing/receiving parameters to/from each other. </li></ul><ul><li>For example, CTS defines a type, Int32 an integral data type of 32 bits (4 bytes) which is mapped by C# through int and VB.Net through its Integer data type. </li></ul>
  30. 30. Language Independent <ul><li>It has the ability to use any language to write applications </li></ul><ul><li>The Component Object Model (COM) already </li></ul><ul><li>Allows reuse of COM components in any COM aware language and allows for COM components to be written in languages such as VB and c++. </li></ul><ul><li>But the superior capabilities of the .NET framework was very easy than COM Interoperatability </li></ul><ul><li>With COM Interoperatability in possible only when the components adhere to a binary standard for interaction. That is every component has to follow rules for communication established for sending information to compiled components </li></ul>
  31. 31. <ul><li>The .NET CLR takes this Interoperatability a step further by allowing cross –language inheritance and standardized exception handling </li></ul>Language Independent
  32. 32. Garbage Collector (GC) <ul><li>CLR also contains the Garbage Collector (GC), which runs in a low-priority thread and checks for un-referenced, dynamically allocated memory space. </li></ul><ul><li>If it finds some data that is no longer referenced by any variable/reference, it re-claims it and returns it to the OS so it can be used by other programs as needed. </li></ul><ul><li>The presence of a standard Garbage Collector frees the programmer from keeping track of dangling data. </li></ul>
  33. 33. .Net Framework
  34. 34. .NET Architecture ASP.NET Web services Web Forms Controls Windows Forms Drawing ASP.NET application Services Windows Application Services .NET Framework Base Classes Common Type System Memory Management Common Language Runtime ADO.NET NET XML SECURITY THREADING DIAGNOSTICS ETC IO Life Cycle Monitoring
  35. 35. CLR Common Type System (Datatypes etc) IL to Native code Compilers Execution Support (Runtime Functions) Security Garbage Collections , Stack ,Code Manager Class Loader and Memory Layout
  36. 36. Features <ul><li>In Team environments ,developers can be free to use whatever language they choose to develop objects .whenever it comes time to integrate the Team members components, we can be sure that they can talk to each other seamlessly on the runtime as well as on the source-code level </li></ul><ul><li>It allows enhancements to existing objects coded In one language to be added using a different language </li></ul>