O slideshow foi denunciado.
Utilizamos seu perfil e dados de atividades no LinkedIn para personalizar e exibir anúncios mais relevantes. Altere suas preferências de anúncios quando desejar.

Introduction to .net framework

A simple document emphasizing the reasons behind evolution of .Net technology and how it simplified the yester-decade's technology issues. This document is simplified and teaches a lame man as why & how .net framework gained importance and how it is ruling the roost.

  • Entre para ver os comentários

Introduction to .net framework

  1. 1. Introduction to .Net Framework<br />NithyaVidhyaarthi<br />
  2. 2. Before .NET<br />Windows GUI development: Win32 API, MFC, Visual Basic, COM<br />Web development: ASP<br />Java – “Write once, run anywhere.”<br />Embrace and extend: Visual J++<br />
  3. 3. Life As a C/Win32 API Programmer<br />Traditional software development for the Windows.<br />C developers are forced to contend with complex memory management and pointer arithmetic. <br />It lacks the benefits provided by the object-oriented approach<br />When you combine the thousands of global functions and data types defined by the Win32 API to an already formidable language, it is little wonder that there are so many buggy applications floating around today.<br />
  4. 4. Life As a C++/MFC Programmer<br /><ul><li>C++ is an object-oriented layeron top of C.
  5. 5. Programmers benefit from the famed “pillars of OOP” (encapsulation, inheritance, and polymorphism).
  6. 6. Microsoft Foundation Classes (MFC) provides a set of C++ classes that facilitate the construction of Win32 applications.
  7. 7. It wraps a “sane subset” of the raw Win32 API behind a number of classes, magic macros, and numerous code-generation tools (wizards).
  8. 8. Regardless of the helpful MFC, programming for Windows using C++ remains a difficult and error-prone experience</li></li></ul><li>Visual Basic 6.0 Programmer<br />Ability to build complex user interfaces, code libraries, and data access logic with minimal fuss and bother. <br />VB6 hides the complexities of the raw Win32 API from view using integrated code wizards, intrinsic data types, classes, and VB-specific functions.<br />Not fully object-oriented<br />No “is-a” relationships between types (i.e., no classical inheritance)<br />No multithreaded applications unless you are willing to drop down to low-level Win32 API calls (which is complex at best and dangerous at worst).<br />
  9. 9. Life As a Java/J2EE Programmer<br />Object oriented with syntactic roots in C++. <br />Java cleans up many unsavory syntactical aspects of C++. <br />Java provides programmers with a large number of predefined “packages” that contain various type definitions. <br />Limited ability to access non-Java APIs.<br />Little support for truecross-language integration. <br />Not appropriate for many graphically or numerically intensive applications. <br />A better approach for such programs would be to use a language such as C++ where appropriate.<br />
  10. 10. Life As a COM Programmer<br />Microsoft’s previous application development framework.<br />reusable binary code.<br />C++ programmers can build COM classes that can be used by VB6. Delphi programmers can use COM classes built using C. <br />COM’s language independence is limited. <br />COM has no support for classical inheritance). <br />COM is extremely complex under the hood.<br />The Active Template Library (ATL) provides a set of C++ classes, templates, and macros to ease the creation of COM types.<br />
  11. 11. Windows DNA Programmer<br /><ul><li>Microsoft has been adding more Internet-aware features into its family of operating systems and products.
  12. 12. COM-based Windows Distributed interNet Applications Architecture (DNA) is quite complex.
  13. 13. Due to the simple fact that Windows DNA requires the use of numerous technologies and languages (ASP, HTML, XML, JavaScript, VBScript, COM(+), and data access API like ADO). </li></li></ul><li>The complete maze…<br />Completely unrelated syntaxes. <br />JavaScript has a syntax much like C, while VBScript is a subset of VB6. The result is a highly confused mishmash of technologies.<br />Each language and/or technology has its own type system: <br />An “int” in JavaScript is not quite the same as an “Integer” in VB6.<br />
  14. 14. .Net, the Rescuer<br />OOP<br />JVM<br />GUI<br />.NET<br />Web<br />component-based design<br />n-tier design<br />
  15. 15. .Net, the Rescuer<br />
  16. 16. .Net provides<br />Integrated environment<br />Internet, Desktop , Mobile devices<br />consistent object-oriented<br />To provide a portable environment<br />A managed environment<br />
  17. 17. What Is .NET<br />.NET is a framework <br />New programming methodology<br />.NET is platform independent / cross platform<br />.NET is language-insensitive<br />
  18. 18. .NET is cross-platform<br />APP.exe<br />?<br />Win32<br />(XP,2K,98)<br />Win64<br />WinCE<br />
  19. 19. .NET Application<br />.NET Framework<br />Narrow view of .Net applications<br />Operating System + Hardware<br />
  20. 20. .Net Framework<br />
  21. 21. .Net Architecture<br />.NET architecture is:<br />multi-language<br />cross-platform<br />based on the CLR, FCL, and JIT technology<br />.NET components are packaged as assemblies<br />
  22. 22. .Net Architecture<br />
  23. 23. .Net Technical Architecture<br />VB<br />C++<br />C#<br />Visual Studio.NET<br />JScript<br />…<br />Common Language Specification<br />WindowsForms<br />ASP.NET: Web Services<br />and Web Forms<br />WindowsForms<br />ADO.NET: Data and XML<br />Base Class Library<br />Common Language Runtime<br />
  24. 24. Common Language Runtime<br />A common runtime for all .NET languages<br />Common type system<br />Common metadata<br />Intermediate Language (IL) to native code compilers<br />Memory allocation and garbage collection<br />Code execution and security<br />Over 15 languages supported today<br />C#, VB, Jscript, Visual C++ from Microsoft<br />Perl, Python, Smalltalk, Cobol, Haskell, Mercury, Eiffel, Oberon, Oz, Pascal, APL, CAML, Scheme, etc.<br />Rational is working on Java compiler for CLR<br />
  25. 25. The CLR Architecture<br />Base Class Library Support<br />Thread Support<br />COM Marshaler<br />Type Checker<br />Exception Manager<br />Security Engine<br />Debug Engine<br />MSIL to Native<br />Compilers (JIT)<br />Code<br />Manager<br />Garbage<br />Collector (GC)<br />Class Loader<br />
  26. 26. CLR Execution Model (Narrow)<br />Code in VB.NET<br />Code in C#<br />Code in another <br />.NET Language<br />VB.NET compiler<br />C# compiler<br />Appropriate<br />Compiler<br />IL(Intermediate<br />Language) code<br />CLR just-in-time<br />execution<br />
  27. 27. CLR Execution Model<br />Source code<br />VB<br />C++<br />C#<br />Unmanaged<br />Component<br />Compiler<br />Compiler<br />Compiler<br />Managed<br />code<br />Assembly<br />IL Code<br />Assembly<br />IL Code<br />Assembly<br />IL Code<br />Common Language Runtime<br />JIT Compiler<br />Native Code<br />Operating System Services<br />
  28. 28. How CLR works?<br />
  29. 29. CLR based execution<br />JIT Compiler<br />APP.exe<br /> OS Process<br />CLR <br />other FCL components<br />Core FCL<br />obj code<br />Underlying OS and HW<br />
  30. 30. Common Language Runtime<br />Execution Engine<br />Compiles Microsoft Intermediate Language (MSIL) into native code<br />Handles garbage collection<br />Handles exceptions<br />Enforces code access security<br />Handles verification<br />Managed v. Unmanaged<br />
  31. 31. Implications of CLR execution model<br />Clients need CLR & FCL to run .NET apps<br />available via Redistributable .NET Framework<br />Design trade-off…<br /><ul><li>managed execution (memory protection, verifiable code, etc.)
  32. 32. portability:
  33. 33. slower execution?</li></li></ul><li>CLR and JIT compiling.<br />Indirect execution of .Net applications.<br />All .NET languages compile to the same CIL.<br />The CLR transforms the CIL to assembly instructions for a particular hardware architecture.<br />This is termed jit’ing or Just-in-time compiling.<br />Some initial performance cost, but the jitted code is cached for further execution.<br />The CLR can target the specific architecture in which the code is executing, so some performance gains are possible.<br />
  34. 34. Advantages of CLR<br />Support for developer services (debugging)<br />Interoperation between managed code and unmanaged code (COM, DLLs).<br />Managed code environment<br />Improved memory handling<br />Improved “garbage collection”<br />
  35. 35. Advantages of CLR<br /><ul><li>JIT allows code to run in a protected environment as managed code.
  36. 36. JIT allows the IL code to be hardware independent.
  37. 37. CLR also allows for enforcement of code access security.
  38. 38. Verification of type safety.
  39. 39. Access to Metadata (enhanced Type Information)</li></li></ul><li>Common Language Infrastructure<br />
  40. 40. CLI<br />
  41. 41. Common Language Infrastructure<br /><ul><li>CLI allows for cross-language development.
  42. 42. Four components:
  43. 43. Common Type System (CTS)
  44. 44. Meta-data in a language agnostic fashion.
  45. 45. Common Language Specification – behaviors that all languages need to follow.
  46. 46. A Virtual Execution System (VES).</li></li></ul><li>Common Type System (CTS)<br />A specification for how types are defined and how they behave.<br />no syntax specified<br />A type can contain zero or more members:<br />Field<br />Method<br />Property<br />Event<br />
  47. 47. Common Type System (CTS)<br />
  48. 48. CTS Data Types<br />
  49. 49. Common Data Types<br />CLR provides a set of primitive types that all languages must support. The data types include:<br />Integer—three types 16/32/64 bits<br />Float—two types: 32/64 bits<br />Boolean and Character<br />Date/time and Time span<br />The primitive types can be collected into<br />Arrays<br />Structures<br />Combination of the two<br />
  50. 50. Common Language Specification (CLS)<br />Not all languages support all CTS types and features<br />C# is case sensitive, VB.NET is not<br />C# supports pointer types (in unsafe mode), VB.NET does not<br />C# supports operator overloading, VB.NET does not<br />CLS was drafted to promote language interoperability<br />vast majority of classes within FCL are CLS-compliant<br />
  51. 51. Comparison to Java<br />Hello.java<br />Hello.class<br />JVM<br />compile<br />execute<br />Source code<br />Byte code<br />Hello.vb<br />Hello.exe<br />CLR<br />compile<br />execute<br />Source code<br />CIL<br />
  52. 52. Base Class Library @ FCL<br />
  53. 53. Base Class Library<br />Similar to Java’s System namespace.<br />Used by all .NET applications<br />Has classes for IO, threading, database, text, graphics, console, sockets/web/mail, security, cryptography, COM, run-time type discovery/invocation, assembly generation<br />
  54. 54. Framework Class Library @ BCL<br />Single consistent set of object oriented class libraries to enable building distributed web applications (Unified Classes)<br />Built using classes arranged across logical hierarchical namespaces<br />Work with all CLR languages<br />No more “VBRun” or “MFC” divide<br />
  55. 55. Example<br />
  56. 56. Intermediate Language (IL)<br /><ul><li>.NET languages are not compiled to machine code. They are compiled to an Intermediate Language (IL).
  57. 57. CLR accepts the IL code and recompiles it to machine code. The recompilation is just-in-time (JIT) meaning it is done as soon as a function or subroutine is called.
  58. 58. The JIT code stays in memory for subsequent calls. In cases where there is not enough memory it is discarded thus making JIT process interpretive.</li></li></ul><li>Queries?<br />
  59. 59. Contact me via<br />Mail:<br /> arunprasadnva@gmail.com<br /> arun85prasad@gmail.com<br />Social network(s) / Services:<br />arunprasadvidhyaarthi – skype, slideshare.com<br />Arun85prasad – twitter, gmail, live, yahoo.com <br />Arun Prasad - facebook, orkut<br />Arunprasad – scribd.com<br />Mobile:<br /> +91 93446 20159<br />
  60. 60. Thank you !!!<br />
  61. 61. Disclaimer<br /> The names of Technologies, Product(s), Companies, Application(s), Tool(s), Utilities, etc provided with this material are intended to reference only. The name(s), brand name(s), trademark(s), registered trademark(s), logo(s), slogan(s) belong to their respective owners in the respective countries.<br />