1 / 35

Microsoft Development Platform Introduction

Microsoft Development Platform Introduction. Lesson: Introduction to the .NET Framework. What is the .NET Framework? What Problems Does .NET Solve? The .NET Framework Components Benefits of Using the .NET Framework Visual Studio .NET: The Tool for .NET Development.

prue
Download Presentation

Microsoft Development Platform Introduction

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. Microsoft Development Platform Introduction

  2. Lesson: Introduction to the .NET Framework • What is the .NET Framework? • What Problems Does .NET Solve? • The .NET Framework Components • Benefits of Using the .NET Framework • Visual Studio .NET: The Tool for .NET Development

  3. What is the .NET Framework? Developer Tools Clients ASP.NET Web Applications Databases XML Web Services User Experiences .NET Framework

  4. What Problems Does .NET Solve? • Even with the Internet, most applications and devices have trouble communicating with each other • Programmers end up writing infrastructure instead of applications • Programmers have had to limit their scope or continually learn new languages

  5. Message Queuing COM+ (Transactions, Partitions, Object Pooling) IIS WMI The .NET Framework Components Visual Basic C++ C# Perl Python … XML Web Services User Interface ASP.NET ADO.NET and XML .NET Framework Class Library Common Language Runtime Win32

  6. MFC/ATL .NET Framework Windows API Visual Basic ASP 1990’s 2000’s 1980’s Benefits of Using the .NET Framework • Based on Web standards and practices • Functionality of .NET classes is universally available • Code is organized into hierarchical namespaces and classes • Language independent

  7. Visual Studio .NET: The Tool for .NET Development Web Forms Tools Windows Forms Tools Visual Studio .NET Multiple Languages Error Handling Web Services Tools Data Access Design Develop Debug Deploy

  8. Lesson: Overview of ASP.NET • What is ASP.NET? • ASP.NET Web Application

  9. What is ASP.NET? • Evolutionary, more flexible successor to Active Server Pages • Dynamic Web pages that can access server resources • Server-side processing of Web Forms • XML Web services let you create distributed Web applications • Browser-independent • Language-independent

  10. ASP.NET Web Application ASP.NET Web Server Clients Web Forms Web.config Page1.aspx Code-behind pages Output Cache Internet Page2.aspx machine.config global.asax WebServices Database Components XML Data

  11. Lesson: Overview of Visual Studio .NET • Why Visual Studio .NET? • Start Page • Available Project Templates • Integrated Development Environment (IDE)

  12. Why Visual Studio .NET? • One IDE for multiple languages and multiple project types • Multiple languages within a project • Multiple project types within a solution • Integrated browser • Debugging support • Customizable interface

  13. Start Page • Online support access • Recent projects

  14. Available Project Templates • The list of available project templates is based on your Profile and Project Type selections

  15. Integrated Development Environment (IDE) Editor/Browser Object Browser SolutionExplorer Toolbox Properties ServerExplorer Task List Dynamic Help

  16. Lesson: Creating an ASP.NET Web Application Project • The Development Process • Web Application Files • Web Application File Structure

  17. The Development Process Create a DesignSpecification Create a New Project Create the Interface and Write Code Test and Debug Build Visual Studio .NET Deploy

  18. Web Application Files • Solution files (.sln, .suo) • Project files (.vbproj, .csproj) • Web application files • ASP.NET Web Forms (.aspx) • ASP.NET Web services (.asmx) • Classes, code-behind pages (.vb or .cs) • Global application classes (.asax) • Web.config file • Project assembly (.dll)

  19. Web Application File Structure Inetpub My Documents wwwroot Visual StudioProjects Solution ProjectA Solution.sln ProjectA.vbproj WebForm1.aspx WebForm1.aspx.vb(Code-behind page) Development Files Assembly Files Bin Build ProjectA.dll

  20. Lesson: Overview of the .NET-Based Languages • Multiple Language Support • The Common Language Runtime • The Common Language Runtime Components • Runtime Compilation and Execution • What are Namespaces? • Using Namespaces

  21. 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

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

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

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

  25. What are Namespaces? • Group related classes • Logical, not physical, grouping • Namespaces are hierarchical • Decrease naming conflicts • Imports keyword in Visual Basic .NET code • Using keyword in C# code Imports System.Data.SqlClient using System.Data.SqlClient;

  26. Using Namespaces • Implicit object declaration • Explicit object declaration Imports System.Web.UI.WebControls ... Dim listBox1 As New ListBox() listBox1.Items.Add("First Item") using System.Web.UI.WebControls; ... ListBox listBox1 = new ListBox(); listBox1.Items.Add("First Item"); Dim listBox1 As New System.Web.UI.WebControls.ListBox() listBox1.Items.Add("First Item") System.Web.UI.WebControls.ListBox listBox1 = new System.Web.UI.WebControls.ListBox(); listBox1.Items.Add("First Item");

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

  28. 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 Private Sub Button1_Click(ByVal sender As System.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

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

  30. 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

  31. Lesson: Creating a Component Using Visual Studio .NET • What are Classes and Components? • Creating a Class • Using Components in an ASP.NET Web Form • Demonstration: Creating a Class in Visual Studio .NET

  32. component What are Classes and Components? • Classes are groups of code with no user interface • Components are compiled classes • Components are compiled as DLL files • Components are used for sharing code between applications Web application Web application Windows application

  33. Creating a Class • Create a Class Library project in Visual Studio .NET • Visual Studio .NET creates a default namespace • Create methods of the class Public Class Shipping Function ShippingCost _ (ByVal sngPrice As Single) As Single '… Return (sngShipping) End Function End Class public class Shipping { public Single ShippingCost (Single sngPrice) { //… return sngShipping; } }

  34. Using Components in an ASP.NET Web Form • Add a reference to the DLL • Instantiate the class object: • Use the object: CompanyA.Shipping x = new CompanyA.Shipping(); Dim x As New CompanyA.Shipping component.dll component.dll Namespace CompanyA Class Shipping Function ShippingCost (…) End ClassEnd Namespace namespace CompanyA { class Shipping { public void ShippingCost (…) { } } } sngShipping = _ x.ShippingCost(sngPrice) sngShipping = x.ShippingCost(sngPrice);

  35. Questions?

More Related