1 / 17

Module 3: Using Microsoft .NET- Based Languages

Module 3: Using Microsoft .NET- Based Languages. Overview. Overview of the .NET-Based Languages Comparison of the .NET-Based Languages. Lesson: Overview of the .NET-Based Languages. Multiple Language Support The Common Language Runtime The Common Language Runtime Components

pisces
Download Presentation

Module 3: Using Microsoft .NET- Based Languages

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Module3:Using Microsoft .NET- Based Languages

  2. Overview • Overview of the .NET-Based Languages • Comparison of the .NET-Based Languages

  3. Lesson: Overview of the .NET-Based Languages • Multiple Language Support • The Common Language Runtime • The Common Language Runtime Components • Runtime Compilation and Execution

  4. Multiple Language Support • The .NET Framework is designed to support many languages • More than 20 languages currently supported • Microsoft provides Visual Basic .NET, C#, Visual J# .NET, and JScript .NET • Benefits of multiple-language support • Code modules are reusable • API access is the same for all languages • The right language is used for the right task • Performance is roughly equal between all languages

  5. The Common Language Runtime • One runtime for all . NET-Based Languages • Manages threads and memory - Garbage collection • Enforces code security - No uninitialized variables - Exception Handling • Eliminates DLL versioning problems - Multiple versions of a DLL can run simultaneously - Applications can specify a version of a DLL to use

  6. .NET Framework Class Library Support Thread Support COM Marshaler Type Checker Exception Manager Security Engine Debug Engine MSIL to Native Compilers Code Manager Garbage Collector Class Loader The Common LanguageRuntime Components

  7. default.aspx Which language? C# code Visual Basic .NET code Visual Basic .NETcompiler HTML MSIL C#compiler JITcompiler Runtime Nativecode Runtime, Compilation and Execution

  8. Runtime, Compilation and Execution • Language Compilation - A web browser request a Web page from a Web server that is running IIS. - The requested Web page, default.aspx, is compiled with the appropriate language compiler, depending on the language that is used to write the page. - The application is compiled to MSIL

  9. Runtime, Compilation and Execution • JIT Compilation - The MSIL is handled by the runtime. - The runtime uses a JIT compiler to compile the MSIL to native code. - After the application is JIT compiled, it is cached so that it does not need to be recompiled for each request.

  10. Runtime, Compilation and Execution • Application Execution - After the application is compiled , the runtime executes the application on the Web server and then generates the HTML and script that is returned to the client.

  11. Lesson: Comparison of the .NET-Based Languages • Visual Basic .NET • C# • Choosing a Language

  12. Visual Basic .NET • Visual Basic .NET is the latest version of Visual Basic • True object-oriented language • Visual Basic Scripting Edition (and JScript) are still used for client-side script Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click Dim i As Integer = 0 Dim x As Double = TextBox1.Text For i = 0 To 4 x *= 2 Label1.Text = Label1.Text & x & "," Next End Sub

  13. C# • C# is a new language • Similar to Java, Visual C++, and Pascal protected void Button1_Click(object sender, EventArgs e) { int i = 0; double x = Convert.ToDouble(TextBox1.Text); for (i=0; i<=4; i++) { x *= 2; Label1.Text = Label1.Text + x + ","; } }

  14. Choosing a Language • .NET Framework class library is the same regardless of language • Performance • All languages are compiled to MSIL • Only performance difference is how each language compiler compiles to MSIL • The runtime compiles all MSIL the same, regardless of its origin • Development experience • C# is similar to Java, C, Visual C++, and Pascal • Visual Basic .NET is similar to Visual Basic • Browser compatibility • ASP.NET code is server-side code, so browser compatibility is not an issue

  15. Review • Overview of the .NET-Based Languages • Comparison of the .NET-Based Languages

  16. Exercise • What role does the CLR play in running ASP.NET page? • What is the role of JIT compilation? • List FOUR languages that are currently supported by .NET. • What is garbage collection and why is it so useful in the .NET Framework?

  17. ~ End of Module 3 ~

More Related