Introduction To Dot Net Siddhesh

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

    Introduction To Dot Net Siddhesh - Presentation Transcript

    1. Introduction to .NET Siddhesh Bhobe
    2. Agenda
      • What is .NET?
      • .NET framework and building blocks
      • ADO.NET
      • Web Services in .NET
      • DNA to .NET Migration
    3. What is Microsoft .NET?
      • From the Microsoft site:
      • “ Microsoft .NET is Microsoft’s XML Web services platform. .NET contains all that’s needed to build and run software based on XML, the lingua franca of Internet data exchange.”
      • .NET includes:
      • The .NET Platform , which is a set of programming tools and infrastructure to enable the creation, deployment, management, and aggregation of XML Web services.
      • .NET experiences (applications!) , which are the means for end users to interact with .NET.
    4. The .NET Platform
      • NET Framework and Visual Studio .NET
      • Server infrastructure
        • Application Center 2000;
        • BizTalk™ Server 2000;
        • Host Integration Server 2000;
        • Mobile Information 2001 Server; and
        • SQL Server™ 2000
      • Building block services
        • They include Passport (for user identification) and services for message delivery, file storage, user-preference management, calendar management, and other functions.
      • Smart Devices
        • Enables PCs, laptops, workstations, smart phones, handheld computers, Tablet PCs, game consoles, and other smart devices to operate in the .NET universe.
    5. The .NET Framework
    6. 1 st generation web applications OS Services Microsoft provided IIS, IE and COM Applications largely operating in a client / server model were augmented with web browser and servers. Browsers Web app developers took advantage of these local services and used HTML to “project” the UI to many types of clients. Servers Data, Hosts UI Logic Biz Logic
    7. 2 nd generation of web applications Combination of “stateless” Web protocols with DNS and IP routing have enabled mass-scale “Geo-Scalability” “ Stateful” “ Stateless” & “ Geo-Scalable” OS Services Biz Logic Tier Rich Client UI Logic Servers Data, Hosts Richer Browsers Separation of data and business logic provide greater scalability and performance while accessing enterprise data. *COM+ Services improve reliability, scalability and manageability. *DHTML for better interactivity.
    8. Next Generation Applications Richer, More Productive User Experience Applications Become Programmable Web Services Standard Browsers Open Internet Communications Protocols (HTTP, SMTP, XML, SOAP) Applications Leverage Globally-Available Web Services Smarter Clients Smarter Devices OS Services Biz Tier Logic Biz Logic & Web Service OS Services Public Web Services Building Block Services Internal Services XML XML XML Servers Data, Hosts XML Other Services XML XML XML HTML
    9. Development/Deployment headaches
      • Non-consistent programming model
      • Knowledge of plumbing code
      • DLL management issues –’DLL HELL’
      • Resource management
      • Non-consistent error handling
      • Deployment issues
      • Security
    10. Couldn’t we have this! No “plumbing” is needed and objects can directly interact Components are built on a “common” substrate.
    11. Couldn’t we have this!
      • Enables shared services:
        • GC, exception handler, security, threading, debugging…
    12. Couldn’t we have this!
      • Common API:
        • IO, Collections, XML, UI…
      • … across all languages
    13. How Much Simpler? HWND hwndMain = CreateWindowEx( 0, "MainWClass", "Main Window", WS_OVERLAPPEDWINDOW | WS_HSCROLL | WS_VSCROLL, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, (HWND)NULL, (HMENU)NULL, hInstance, NULL); ShowWindow(hwndMain, SW_SHOWDEFAULT); UpdateWindow(hwndMain); Form form = new Form(); form.Text = "Main Window"; form.Show(); Windows API .NET Framework
    14. Architecture Visual Studio.NET Windows COM+ Services Common Language Runtime Base Class Library ADO.NET and XML ASP.NET Windows Forms Common Language Specification VB C++ C# JScript …
    15. Common Language Runtime VB Source code Compiler C++ C# Compiler Compiler Assembly IL Code Assembly IL Code Assembly IL Code Operating System Services Common Language Runtime JIT Compiler Native Code Managed code Unmanaged Component
    16. Compilation Source Code C++, C#, VB or any .NET language Metadata IL Managed code Resources myprogram.DLL Assembly is basic deployable unit in .NET VS.NET Csc.exe, vbc.exe, etc. Compiler Assembly DLL or EXE
    17. Assemblies The Building Block
      • Deployment unit for types and resources: a “logical dll”
      • Self describing through a manifest
      • Fundamental unit of versioning, reuse, deployment and permission grants and requests
    18. ADO.NET
    19. ADO.NET Architecture OdbcConnection OdbcCommand OdbcDataAdapte r Odb cDataReader ODBC .NET Data Provider COM Inter op ODBC
    20. ADO.NET
    21. Making Database Connection
      • Using SQL Server .NET data provider.
      • SqlConnection connSql=new SqlConnection ("Address=dotsrv;uid=sa;pwd=sql;connect Timeout=5;");
      • Using OLEDB.NET Provider to connect to Oracle
      • OleDbConnection connOle=new OleDbConnection ("Provider=OraOLEDB.Oracle.1;Data Source=_CRUISEDB; user id=xat;password=xat;");
      • Using ODBC.NET Provider to connect to Oracle
      • OdbcConnection connODBC=new OdbcConnection ("DSN=connectOra;Server=_CRUISEDB;uid=xat;pwd=xat;");
    22. ADO and XML in the .NET Framework Managed Provider DataReader Command Connection Sync Controls, Designers, Code-gen, etc DataSet XmlReader XSL/T, X-Path, etc XmlData- Document DataAdapter
    23. DataSet
      • Relational View of Data
        • Tables, Columns, Rows, Constraints
        • Navigate between tables using Relations
          • DataRow[] orders = customer.GetChildren("custOrd");
      • Source-agnostic
        • XML, Relational, Application data
      • Remotable
        • No knowledge of source of data
        • Never holds connection state
        • DataSet as argument to WebMethods
          • Serializes as XML Schema/Data
      DataSet Tables Table Columns Column Constraints Constraint Rows Row Relations Relation
    24. Example: Reading/Writing XML
      • // Load DataSet with XML
      • DataSet ds = new DataSet();
      • ds.ReadXml("inventory.xml");
      • // Add a record to the Inventory table
      • DataTable inventory = ds.Tables["Inventory"];
      • DataRow row = inventory.NewRow();
      • row["TitleID"]=1;
      • row["Quantity"]=25;
      • inventory.Rows.Add(row);
      • // Write out XML
      • ds.WriteXml("updatedinventory.xml");
    25. Example: Associating an XmlDataDocument with a DataSet
      • private static XmlDataDocument xmlData;
      • public static DataSet LoadDataSet(String schema) {
      • DataSet ds = new DataSet();
      • ds.ReadXmlSchema(schema);
      • xmlData = new XmlDataDocument(ds);
      • xmlData.Load("po.xml");
      • return ds;
      • }
      • public static void SaveChanges() {
      • xmlData.Save("po.xml");
      • }
    26. Example: X/Path over Relational
      • public static void doXml(DataSet po) {
      • // Associate an XmlDataDocument with the DataSet
      • XmlDataDocument xmlData = new XmlDataDocument(po);
      • // Do an X/Path Query
      • XmlNodeList nodes = xmlData.SelectNodes("//Item[@qty>100]");
      • // Write out results
      • Console.WriteLine("Matches="+nodes.Count);
      • foreach(XmlNode node in nodes) {
      • DataRow row =
      • xmlData.GetRowFromElement((XmlElement)node);
      • // Mark Customer for Deletion
      • row.Delete();
      • }
      • }
    27. Example: XSL/T over Relational
      • public static void doTransform(DataSet po) {
      • XmlDataDocument xmlData = new XmlDataDocument(po);
      • // Do a Transform
      • XslTransform xsltransform = new XslTransform();
      • xsltransform.Load("po.xsl");
      • XmlReader xReader = xsltransform.Transform(xmlData, null);
      • }
    28. Summary
      • ADO.NET provides a model for bridging the gap between XML and Relational data
        • DataSet provides Relational View
          • Persists/loads data as XML
          • Persists/loads schema as XSD
          • Serializes as XML with in-line schema
        • XmlDataDocument provides an XML view
          • Exposes relational data to XML tools
          • Exposes a relational subset of XML data
          • Preserves Fidelity of XML
    29. Web Services in .NET
    30. Web Services are “Key” in .NET
    31. Web Services Infrastructure in .NET
      • IIS and COM+ provides the hosting environment
      • APIs
        • COM for implementing the business façade, business logic, and data access layers
        • ADO, OLE DB, and ODBC for implementing data access to a variety of data stores
        • MSXML to help construct and consume XML messages in the Web Service listener
        • Active Server Pages (ASP) or ISAPI for implementing the Web Service listener
      • NLBS and Clustering for scalability
      • IPSec, HTTP Basic authentication, Digest authentication, Kerberos 5 authentication, NTLM authentication, or your own custom scheme.
    32. .NET Web Services Infrastructure
      • Smart Clients and Devices to consume Web Services
      • Suite of .NET Servers, including Win 2K family and .NET Enterprise Servers
      • Development Tools
        • VS.NET
          • Single unified IDE for all languages
          • Enable applications as Web Services
          • Aggregate Web Services
        • .NET Framework
          • Build, deploy and run Web Services
    33. Service Description
      • Uses WSDL to describe itself
      • Uses namespaces to uniquely identify service endpoints
      • Server-side component that map Web Services to COM components using WSDL and Web Services Meta Language (WSML) description
    34. Service Implementation
      • Several languages running on Common Language Infrastructure: VB.NET, C#, JScript
      • SOAP Toolkit for constructing, transmitting, reading and processing SOAP messages
    35. Service Publishing, Discovery and Binding
      • Used to have DISCO for discovering Web Services
      • Now supports UDDI
      • Provides .NET UDDI server
      • Office XP offer support for service discovery through UDDI
    36. Service Invocation and Execution
      • Use of built-in .NET SOAP message classes
      • Construct Web Service listeners using MSXML, ASP, ISAPI etc
      • Use SOAP toolkit to build a Web Service listener
      • Client-side components for invoking Web Services
    37. Creating and Consuming Web Services in VS.NET
    38. Create New ASP.NET Web Service Project
    39. Project and Sample Files created
    40. Add New Web Service to the Project
    41. default.asmx
      • <%@ WebService Language =&quot;vb&quot; Codebehind =&quot;default.asmx.vb&quot; Class =&quot;DegreesWebService._default&quot; %>
    42. default.asmx.vb
    43. What makes this a web service?
      • &quot;Imports System.Web.Services&quot; brings in the functionality needed under this class.
      • &quot;<WebService(Namespace := &quot;http://tempuri.org/&quot;)> _&quot; makes this class callable from the web.
      • &quot;Inherits System.Web.Services.WebService&quot;, makes this class inherit all the methods and properties of this class.
      • &quot;<WebMethod()>&quot; in front of a method makes this callable from the web.
    44. Our Web Service
    45. Building and testing the web service
      • Make sure that our starting page for the project is the default.asmx page
      • Then go to Debug > Start , or press F5 . VS builds the project and pops up a web browser window with this file.
      • This is simply a medium that Microsoft has provided so that we can test our Web Service.
    46. Testing a web service
    47. Enter Values…
    48. Invoke…
    49. Add Web Reference
    50. Web Reference added
    51. Modified default.aspx
    52. Code behind
    53. More…
      • http://www.devasp.net/net/search/default.asp?c_id=534
      • http://www.xefteri.com/articles/nov182002/default.aspx
      • http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vstechart/html/vbtchgettingstartedwithxmlwebservicesinvisualstudionet.asp
    54. DNA to .NET Migration
    55. Windows DNA architecture Windows NT 4/Windows 2000 COM COM COM IIS ASP SQL
    56. .NET Framework
      • Common Language Runtime
      • Managed data and code
      • Unified framework library
      • Multiple language support
      #include <stdio.h> int main() { int a[100]; for (int x=0; x<100; x++) a[x]=x*x; for (int y=0; y<100; y++) a[y] = y*y; return 0; } #include <stdio.h> int main() { int a[100]; for (int x=0; x<100; x++) a[x]=x*x; for (int y=0; y<100; y++) a[y] = y*y; return 0; } #include <stdio.h> int main() { int a[100]; for (int x=0; x<100; x++) a[x]=x*x; for (int y=0; y<100; y++) a[y] = y*y; return 0; } 0010 1100 0101 1010 1100 0011 1111 0101 1010 0101 0000 0000 1000 1011 0101 0000 1111 1100 0100 1101 0101 1010 1100 0011 MSIL CLR VB C# COBOL
    57. DNA to .NET mappings
      • Presentation tier mapping
        • Web Tier - ASP to ASP.NET
        • Rich client – Win32API to WinForms
      • Middle tier mapping
        • Components – COM to .NET
        • Connectivity – DCOM to CLR Remoting
        • Connectivity – ADO to ADO.NET
      • Language mapping
        • VB6 to VB.NET
        • C++ to C#
    58. Presentation tier mapping
      • ASP to ASP.NET
      Separate code behind Inline code/presentation Config changes are automatically detected and applied Changes require web server restart or OS reboot Simple xcopy or FTP upload can handle deployment Registration required to deploy site Access to entire Framework Access to limited API Built in session state User managed session state VB.NET, C#, COBOL.NET, … VBScript and JavaScript Compiled code Interpreted code ASP.NET ASP
    59. Migration issues
      • ASP.NET requires IIS5
      • No migration tools available from ASP to ASP.NET
      • ASP and ASP.NET co-exist
        • Application/Session variables not shared
        • Global.asa vs. Global.asax
    60. Rich Client Migration
      • Existing frameworks
        • C++/MFC library
        • Visual BASIC UI
      • .NET “Smart” client
        • Unified Windows Form
        • RAD environment
      • Migration
        • VB to VB.NET Wizard
        • No migration from MFC to WinFrom
    61. Recommendations
      • C++
        • C++/MFC/ALT does not have a migration wizard.
        • Managed extension and new web service consumer capabilities can be used
      • VB
        • Upgrade wizard converts most of the code
        • Watch out for unsupported features like Dynamic Data Exchange, OLE Containers etc.
    62. Rich client benefits
      • Managed code makes application more robust
      • Utilizes unified framework libraries across languages
      • Inherent support for ADO.NET and web services
    63. Middle tier components
      • COM Component
        • 2 levels of support - VB and C++/ATL
        • Registry complexities
      • .NET Component
        • Multiple language support – CLR
        • Self contained – no dependencies
      • Migration
        • Source level migration – VB.NET
        • Backward and forward compatibility between COM and .NET
    64. DCOM Migration
      • DCOM
        • Proprietary protocol
        • Is not internet friendly
      • .NET Remoting
        • Based on standard protocol
        • Completely flexible and configurable
        • Supports multiple invocation mechanism
      • Migration
        • .NET uses DCOM protocol for backward compatibility
    65. ADO to ADO.NET
      • ADO
        • COM based connectivity model
        • Specification for interpreted environment
        • Always connected scenario
      • ADO.NET
        • Common specs for .NET
        • XML based dataset model
        • Disconnected scenario
      • Migration
        • Backward compatibility to ADO
        • ADO and ADO.NET can co-exist
    66. Language Migration
      • VB to VB.NET
        • Wizard based
        • Developer review required
      • C++ to C++.NET
        • Managed extension
        • Native + managed code
        • No wizard migration
      • C++ to C#
        • Complete rewrite required
        • Fully Managed code
        • Unsafe option
    67. Migration strategies
      • Partial web front migration
        • Migrating Web front end while retaining business logic component
      • Rich client migration
        • Migrating Rich client to WinForms while retaining DCOM compatibilities
      • Language level migration
        • Using available wizards to migrate to .NET component from COM components
    68. Partial web front migration
      • Retain COM components
      • Upgrade ASP to ASP.NET
      • COM interop performance penalty
      COM COM COM IIS ASP IIS ASP
    69. Rich client migration
      • Retain COM components
      • UpgradeWin32 to Winform
      • COM interop performance penalty
      Win32 App .NET Winfrom COM COM COM
    70. COM to .NET migration
      • Migrate business logic
      • Partial or complete rewrite
      • Increased testing/debugging cycle
      VB to VB.NET Wizard migration C++ to managed C++.NET Manual C++ to C# rewrite COM .NET
    71. Another way to look at it… VB6 Front End Component Access COM COM COM
    72. Expose Your COM Components … External Apps VB 6 Web Service COM COM COM SOAP
    73. Convert Front End … VB 6 VB.NET VB 6 COM Interop Upgrade Tool Web Service External Apps COM COM COM SOAP
    74. Convert COM to .NET … VB.NET Migration Tool .NET .NET .NET COM COM COM
    75. Convert Fully … VB.NET VB 6 .NET Interop Web Service External Apps .NET .NET .NET
    76. Migration Notes
      • ASP.NET give huge performance improvements over ASP
      • Managed code (Winform, BL Components) are more robust then Win32/COM
      • Everything need not be migrated at once
      • Migration can be carried out in phases
      • Post migration, application can be extended for different interface e.g. Mobile forms, web service, compact framework etc.
    77. Useful Links http://www.microsoft.com/net http://www.gotdotnet.com http://www.sharpdevelop.org http://www.go-mono.com http://www.icsharpcode.net http://www.ecma.ch (C# & CLI standard) http://www.dotnet247.com/
    SlideShare Zeitgeist 2009

    + Siddhesh BhobeSiddhesh Bhobe Nominate

    custom

    1107 views, 0 favs, 0 embeds more stats

    High level introduction to .NET

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 1107
      • 1107 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 84
    Most viewed embeds

    more

    All embeds

    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