.NET Framework Billy Reynoso billyr@microsoft.com
Plataforma.NET Visual Studio.NET.NET Enterprise Servers.NET Framework.NET Building Blocks Services Sistemas Operativos en servers, desktop y dispositivos
Definición de.net Software como Servicio (XML Web Services) Servicio corriendo en cualquier plataforma, programado en cualquier lenguaje y consumido en cualquier dispositivo OOP: Frameworks propietarios Componentes: protocolos y formatos específicos COM y DCOM, EJB y RMI Web Services: XML, SOAP, WSDL, UDDI Runtime: CLR, CTS, MSIL ASP.NET Base classes Building blocks
Framework y Herramientas VB C++ C# JScript J# Common Language Specification ASP.NET Web Forms Web Services Mobile Internet Toolkit ADO.NET and XML Base Class Library Common Language Runtime Sistema Operativo Windows Forms Visual Studio.NET Herramientas: ILDASM DUMPBIN PE File Format Viewer GAC.EXE Assembly Registration Utility ILASM MSIL Assembler XSD.EXE Schema Definition Tool
Common Language Runtime Base Class Library Support Thread Support Type Checker Security Engine COM Marshaler Exception Manager Debug Engine IL to Native Compilers Code Manager Garbage Collector Class Loader
Common Type System Tipos simples Int16 Int32 UInt32 String Tipos complejos GUID RegEx DateTime TimeSpan Todo es un objeto Los tipos primitivos tienen clases correspondientes en el.net Framework Int es un alias de System.Int32 (que deriva de System.ValueType)
Demo 1 CTS: Regular Expressions
Demo 2 Formatos y herramientas.net Portable Executables Dumpbin /all Metadata Ildasm Reflection API Meta sample Precompilación JIT (PE pre-jit) Ngen Type Library Exporter Tlbexp Assembly Registration Tool (exp+registración) Regasm Strong name Tool Sn
Soporte de múltiples lenguajes Object Oriented JScript Python Dynamically typed Perl Scheme/Lisp Haskell Script Java C# Functional/ Logic Mercury Prolog Haskell C++ Statically typed ML
Tipos de lenguajes Lang. Func. Logic OO Lazy Pure Conc Par ll Static Runtime Typed Typed Script Mercury Scheme Eiffel SML Alice Oberon Component Pascal Mondrian Haskell Oz Cilk O Caml Providers
Múltiples lenguajes & CLR Memoria: Objetos alocados en COBOL se pueden utilizar desde VB Exceptions: Por ejemplo: VB arroja una Excepción C# puede atraparla (catch) Classes: Una clase VB puede heredar de una clase C# y viceversa JVM fue un gran progreso, pero CLR es explícitamente multilenguaje Se puede compartir más (p.ej. remoting, generic, tools, debugging entre lenguajes)
Soporte de múltiples lenguajes VB.NET Dim s as String s = "authors" Dim cmd As New SqlCommand("select * from " & s, sqlconn) cmd.executereader() C# string s = "authors"; SqlCommand cmd = new SqlCommand("select * from "+s, sqlconn); cmd.executereader(); String *s = S"authors"; SqlCommand cmd = new SqlCommand(String::Concat(S"select * from ", s), cmd.executereader(); sqlconn); C++
Soporte de múltiples lenguajes String s = "authors"; J# SqlCommand cmd = new SqlCommand("select * from "+s, sqlconn); cmd.executereader();
Soporte de múltiples lenguajes JScript var s = "authors" var cmd = new SqlCommand("select * from " + s, sqlconn) cmd.executereader() String *s = S"authors"; SqlCommand cmd = new SqlCommand(String::Concat(S"select * from ", s), sqlconn); cmd.executereader(); Perl s = "authors" cmd =SqlCommand("select * from " + s, sqlconn) cmd.executereader() Python
Soporte de múltiples lenguajes Cobol ENVIRONMENT DIVISION. CONFIGURATION SECTION. REPOSITORY. CLASS SqlCommand AS "System.Data.SqlClient.SqlCommand" CLASS SqlConnection AS "System.Data.SqlClient.SqlConnection". DATA DIVISION. WORKING-STORAGE SECTION. 01 str PIC X(50). 01 cmd-string PIC X(50). 01 cmd OBJECT REFERENCE SqlCommand. 01 sqlconn OBJECT REFERENCE SqlConnection. PROCEDURE DIVISION. *> Establish the SQL connection here somewhere. MOVE "authors" TO str. STRING "select * from " DELIMITED BY SIZE, str DELIMITED BY " " INTO cmd-string. INVOKE SqlCommand "NEW" USING BY VALUE cmd-string sqlconn RETURNING cmd. INVOKE cmd "ExecuteReader".
Soporte de múltiples lenguajes RPG DclFld MyInstObj Type( System.Data.SqlClient.SqlCommand ) DclFld s Type( *string ) s = "authors" MyInstObj = New System.Data.SqlClient.SqlCommand("select * from "+s, sqlconn) MyInstObj.ExecuteReader() Fortran assembly_external(name="system.data.sqlclient.sqlcommand") sqlcmdcharacter*10 xsqlcmd Cmd x='authors' cmd = sqlcmd("select * from "//x, sqlconn) call cmd.executereader() end
Soporte de múltiples lenguajes APL s String.New authors cmd SqlCommand.New ( select * from,s.tostring σ) sqlconn cmd.executereader Smalltalk s := 'authors'. cmd := SqlCommand('select * from '+s, sqlconn). cmd.executereader().
Scheme (let* ( (s "authors") (cmd (new-sqlcommand (string-append "select * from " s) sqlconn))) (execute-command cmd)) local do end Soporte de múltiples lenguajes s: STRING cmd: SQLCOMMAND s := "authors" create cmd("select * from " + s, sqlconn) cmd.executereader() Eiffel ExecuteReader = invoke System.Data.SqlClient.ExecuteReader(); SqlCommand = create System.Data.SqlClient.SqlCommand(String,\ System.Data.SqlClient.SqlConnection); query = sqlconn -> let{ s = "authors"; } in { cmd <- SqlCommand ("select * from "+s, sqlconn); cmd # ExecuteReader(); }; Mondrian
Demos de Múltiples Lenguajes Multi Demo COBOL, RPG, Component Pascal, Eiffel*, VB Compilador Lisp en Framework SDK IDEs freeware * Único lenguaje OO que incluye estrategia constructiva de construcción (un método y un ambiente) Cubre análisis, diseño e implementación
.NET Framework Library System System System.Data System.Data System.Xml System.Xml System.Web System.Web Globalization Globalization Diagnostics Diagnostics Configuration Configuration Collections Collections Resources Resources Reflection Reflection Net Net IO IO Threading Threading Text Text ServiceProcess ServiceProcess Security Security Common Common OleDb OleDb SQLTypes SQLTypes SqlClient SqlClient XPath XPath XSLT XSLT Runtime Runtime InteropServices InteropServices Remoting Remoting Serialization Serialization Serialization Serialization Configuration Configuration SessionState SessionState Caching Caching Security Security Services Services Description Description Discovery Discovery Protocols Protocols UI UI HtmlControls HtmlControls WebControls WebControls System.Drawing System.Drawing Imaging Imaging Drawing2D Drawing2D Text Text Printing Printing System.Windows.Forms System.Windows.Forms Design Design ComponentModel ComponentModel
Demos de Base Classes Serialización BCL
Windows API Mucho más simple HWND hwndmain = CreateWindowEx( 0, "MainWClass" 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);.NET Framework Form form = new Form(); form.text = "Main Window"; form.show();
Seguridad (ASP.NET) Soporte de autenticación y autorización en ASP.NET Extensible y configurable Transparencia de esquema de autenticación Modelo de deployment simple Soporte granular para autorizaciones declarativas e imperativas Utiliza seguridad basada en evidencia de CLR Soporta Application Layer security
Por ejemplo: Autenticación ASP.NET es una extensión ISAPI Sólo recibe requests para contenido mapeado Windows Authentication (via IIS) Basic, Digest, NTLM, Kerberos, IIS Certificate Support Autenticación basada en forms (Cookie) Verificación de credencial de Aplicación IIS: permitir usuarios anónimos Usar SSL!! Configurar ASP.NET Cookie Authentication Escribir página de Login Soporta autenticación por Microsoft Passport Custom Authentication
SQL Server 2000 Web Services Toolkit BizTalk Server 2002 Web Services Toolkit Web Services Interoperability http://www.ws-i.org Global XML Web Services Architecture (GXA) El futuro
GXA: Extendiendo la semántica Seguridad: prioridad número 1 Soportar seguridad end-to-end incluyendo autenticación, autorización, integridad de mensajes y encriptación Routing: escalabilidad y tolerancia a fallas Configuración dinámica de paths de mensajes Reliable Messaging: necesaria para aplicaciones de misión crítica Garantía de entrega con amplio rango de semántica (at-leastonce, at-most-once, exactly-once) Transacciones: entre empresas Soportar una amplia variedad de semánticas de transacción y compensación Formatos diversos sin conversión
Global XML Web Services Architecture - GXA Transactions Reliable Messaging Referral Security Directory Routing License Inspection Description
Todo junto ahora SOAP Message Routing Security and License <?xml version="1.0" encoding="utf-8"?> <S:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/xmlschema" <?xml version="1.0" encoding="utf-8"?> xmlns:xsi="http://www.w3.org/2001/xmlschema-instance"> <S:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" <S:Header> xmlns:xsd="http://www.w3.org/2001/xmlschema" <m:path xmlns:xsi="http://www.w3.org/2001/xmlschema-instance"> xmlns:m="http://schemas.xmlsoap.org/rp"> <m:action>http://tickers-r-us.org/getquote</m:action> <S:Header> <m:to>soap://tickers-r-us.org/stocks</m:to> <m:path xmlns:m="http://schemas.xmlsoap.org/rp"> <m:action>http://tickers-r-us.org/getquote</m:action> <m:from>mailto:johnsmith@isps-r-us.com</m:from> <m:to>soap://tickers-r-us.org/stocks</m:to> <m:id>uuid:84b9f5d0-33fb-4a81-b02b-5b760641c1d6</m:id> <!-- <m:from>mailto:johnsmith@isps-r-us.com</m:from> A Simple Quote Web Service --> </m:path> <m:id>uuid:84b9f5d0-33fb-4a81-b02b-5b760641c1d6</m:id> <wssec:credentials </m:path> xmlns:wssec="http://schemas.xmlsoap.org/ws/2001/10/security"> <wssec:credentials <wslic:binarylicense xmlns:wssec="http://schemas.xmlsoap.org/ws/2001/10/security"> <wslic:binarylicense xmlns:wslic="http://schemas.xmlsoap.org/ws/2001/10/licenses" wslic:valuetype="wslic:x509v3" xmlns:wslic="http://schemas.xmlsoap.org/ws/2001/10/licenses" xsi:type="xsd:base64binary"> wslic:valuetype="wslic:x509v3" dwjzy3jpymvylvblc..efw0wmtewmtawmd xsi:type="xsd:base64binary"> </wslic:binarylicense> dwjzy3jpymvylvblc..efw0wmtewmtawmd </wssec:credentials> </wslic:binarylicense> </S:Header> </wssec:credentials> <S:Body> </S:Header> <S:Body> <tru:stocksymbol <tru:stocksymbol xmlns:tru="http://tickers-r-us.org/payloads"> xmlns:tru="http://tickers-r-us.org/payloads"> QQQ QQQ </tru:stocksymbol> </S:Body> </S:Body> </S:Envelope>
Framework.NET: Consecuencias Amplia aceptación de la industria Programación distribuida potenciada y simplificada Resuelve el problema de frameworks variables y redundantes (unifica los objetos) Resuelve problemas de deployment y versioning Unifica los tipos e iguala los lenguajes CLR/MSIL: Proporciona máxima performance Servicio en cualquier plataforma, programación en cualquier lenguaje, presentación en cualquier dispositivo
Referencias http://msdn.microsoft.com/webservices http://msdn.microsoft.com/net http://www.gotdotnet.com http://www.asp.net http://www.xmethods.com http://www.ws-i.org http://www.uddi.org http://www.w3.org/tr/wsdl http://www.w3.org/tr/soap
Textos http://www.microsoft.com/mspress http://www.sams.com http://www.wrox.com http://www.oreilly.com