• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Introduction To Dot Net Siddhesh
 

Introduction To Dot Net Siddhesh

on

  • 3,769 views

High level introduction to .NET

High level introduction to .NET

Statistics

Views

Total Views
3,769
Views on SlideShare
3,758
Embed Views
11

Actions

Likes
1
Downloads
136
Comments
0

2 Embeds 11

http://www.slideshare.net 9
http://www.linkedin.com 2

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Introduction To Dot Net Siddhesh Introduction To Dot Net Siddhesh Presentation Transcript

    • Introduction to .NET Siddhesh Bhobe
    • Agenda
      • What is .NET?
      • .NET framework and building blocks
      • ADO.NET
      • Web Services in .NET
      • DNA to .NET Migration
    • 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.
    • 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.
    • The .NET Framework
    • 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
    • 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.
    • 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
    • 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
    • Couldn’t we have this! No “plumbing” is needed and objects can directly interact Components are built on a “common” substrate.
    • Couldn’t we have this!
      • Enables shared services:
        • GC, exception handler, security, threading, debugging…
    • Couldn’t we have this!
      • Common API:
        • IO, Collections, XML, UI…
      • … across all languages
    • 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
    • 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 …
    • 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
    • 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
    • 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
    • ADO.NET
    • ADO.NET Architecture OdbcConnection OdbcCommand OdbcDataAdapte r Odb cDataReader ODBC .NET Data Provider COM Inter op ODBC
    • ADO.NET
    • 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;");
    • 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
    • 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
    • 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");
    • 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");
      • }
    • 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();
      • }
      • }
    • 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);
      • }
    • 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
    • Web Services in .NET
    • Web Services are “Key” in .NET
    • 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.
    • .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
    • 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
    • Service Implementation
      • Several languages running on Common Language Infrastructure: VB.NET, C#, JScript
      • SOAP Toolkit for constructing, transmitting, reading and processing SOAP messages
    • 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
    • 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
    • Creating and Consuming Web Services in VS.NET
    • Create New ASP.NET Web Service Project
    • Project and Sample Files created
    • Add New Web Service to the Project
    • default.asmx
      • <%@ WebService Language =&quot;vb&quot; Codebehind =&quot;default.asmx.vb&quot; Class =&quot;DegreesWebService._default&quot; %>
    • default.asmx.vb
    • 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.
    • Our Web Service
    • 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.
    • Testing a web service
    • Enter Values…
    • Invoke…
    • Add Web Reference
    • Web Reference added
    • Modified default.aspx
    • Code behind
    • 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
    • DNA to .NET Migration
    • Windows DNA architecture Windows NT 4/Windows 2000 COM COM COM IIS ASP SQL
    • .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
    • 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#
    • 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
    • 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
    • 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
    • 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.
    • Rich client benefits
      • Managed code makes application more robust
      • Utilizes unified framework libraries across languages
      • Inherent support for ADO.NET and web services
    • 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
    • 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
    • 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
    • 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
    • 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
    • Partial web front migration
      • Retain COM components
      • Upgrade ASP to ASP.NET
      • COM interop performance penalty
      COM COM COM IIS ASP IIS ASP
    • Rich client migration
      • Retain COM components
      • UpgradeWin32 to Winform
      • COM interop performance penalty
      Win32 App .NET Winfrom COM COM COM
    • 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
    • Another way to look at it… VB6 Front End Component Access COM COM COM
    • Expose Your COM Components … External Apps VB 6 Web Service COM COM COM SOAP
    • Convert Front End … VB 6 VB.NET VB 6 COM Interop Upgrade Tool Web Service External Apps COM COM COM SOAP
    • Convert COM to .NET … VB.NET Migration Tool .NET .NET .NET COM COM COM
    • Convert Fully … VB.NET VB 6 .NET Interop Web Service External Apps .NET .NET .NET
    • 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.
    • 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/