1 / 32

Ingegneria del software I

Ingegneria del software I. Seminario 2: Microsoft .NET. Microsoft .NET piattaforma. Visual Studio.NET. .NET Enterprise Servers. .NET Building Block & Services. .NET Devices, User Experience. Microsoft .NET piattaforma. Visual Studio.NET. .NET Enterprise Servers.

karim
Download Presentation

Ingegneria del software I

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. Ingegneria del software I Seminario 2: Microsoft .NET

  2. Microsoft.NET piattaforma Visual Studio.NET .NET Enterprise Servers .NET Building Block & Services .NET Devices, User Experience

  3. Microsoft.NET piattaforma Visual Studio.NET .NET Enterprise Servers .NET Building Block & Services .NET Devices, User Experience

  4. Visual Studio.NET • Framework per sviluppo ed integrazione dei .NET Enterprise Servers sia con .NET building block services che .NET devices. [6] VB C++ C# Scripts … CLS (Common Language Specification) ASP.NET Web Service Web Form Integrates into the system ADO.NET : Data and XML Base Class Library CLR (Common Language Runtime)

  5. CLS (Common Language Specification) • È un insieme di specifiche per l’interoperabilità tra linguaggi. [7] • È un insieme di specifiche di compilazione per l’indipendenza dai linguaggi. [8] • Sono definiti: tipi, metodi, campi, proprietà, enumerazioni, eccezioni, interfacce, eventi, etc.

  6. CLR (Common Language Runtime) • Carica ed esegue codice scritto in runtime-aware per i linguaggi di programmazione. [14] • Le caratteristiche dell’ambiente runtime [14] : • cross-language integration • self-describing components • simple deployment and versioning • integrated security services. • Un unico framework per il progetto, lo sviluppo, l’implementazione, e l’esecuzione di componenti ed applicazioni distribuiti. [9]

  7. Microsoft.NET Platform Visual Studio.NET .NET Enterprise Servers .NET Building Block & Services .NET Devices, User Experience

  8. .NET Enterprise Server Configuration Exchange Server 2000 Mainframe / Other Data Sources SQL Server 2000 Host Integration Server 2000 COM+ Mobile Information Server 2000 Mobile Devices BizTalk Server 2000 Internet Security & Acceleration Server 2000 Supplier / Consumer of XML e-documents Application Center 2000 Internet Information Server Clients on the web

  9. Microsoft .NET Framework ASP+ Win Forms Web Forms Web Services Services FrameWork Base Data Debug . . . Common Language Runtime System Services

  10. Service Framework • Fornisce classi di oggetti a supporto degli sviluppatori per .NET. [14] Base Classes Programming Tools Type System Debugging/Trace I/O and Network Resources Component Model Configuration/Install Drawing (GDI+) EventLog/PerfCounter Threading Globalization Cryptography Serialization

  11. Il linguaggio C# • Caratteristiche del C# [16] • Semplicità • Type safe • Consistenza • Supporto alle versioni • Object Orientation • Flessibilità

  12. C# - caratteristiche • Complessità del C++, • “->” / “::” / “.” notazioni criptiche • Particolari tipo di dato “wchar_t”, “__int64” … • Utilizzo degli interi come booleani, • problema del ‘==‘ e ‘=‘ • In C#, • Notazione principale è il “.”. • È stato introdotto il tipo bool per eliminare confusioni

  13. C# - caratteristiche • In C# non ci sono puntatori. • La gestione della memoria è a carico del garbage collector fornito con l’ambiente .NET • Usando la modalità “unsafe” si può comunque accedere alla memoria direttamente.

  14. C# - Object Orientation • Incapsulamento, ereditarietà, polimorfismo • I metodi della classi non sono virtual per default • public, private, protected e internal • L’ereditarietà permessa è singola

  15. C# - Type Safety • Le variabili non inizializzate non sono ammesse • Il casting dei tipi ad UNSAFE non è permesso • Data overflow, array index boundary checking

  16. Un semplice esempio in C# • hello world. using System; class Hello { public static void Main(string[] args) { Console.WriteLine(“hello, world”); // print the command line arguments for (int i = 0; arg < args.Length; i++) Console.WriteLine(“arg [0],[1]”, i, args[i]); } }

  17. SDC (Self-Describing Components) • I servizi forniti dal runtime sono metadata driven, questi metadati aggiungono informazioni agli eseguibili, come le definizioni di interfacce che prima specificate in IDL, TLB, proxy/stubs.

  18. Architettura dei Web Services Web Service Developer Web Application Developer Request SCL Author class, ASMX Author Page that calls the Proxy Web Service : ASMX Deploy Application Web Server Web Application : ASMX Run Method SDL ASPX Run Proxy Generator Deploy Application C#, VB Deploy Application Web Server Call Methods Web Form Proxy

  19. Web Service, ASMX • Web service server salvato come “asmx” file. • Richieste di web services basate su comunicazioni XML / SOAP. • Oggetti e risorse accessibili via URL

  20. Web Service Development Web Service Developer Web Application Developer  Request SCL Author class, ASMX  Author Page that calls the Proxy Web Service : ASMX Deploy Application Web Server Web Application : ASMX  Run Method SDL ASPX  Run Proxy Generator  Deploy Application C#, VB  Deploy Application Web Server  Call Methods Web Form Proxy

  21. 1Author Class, ASMX <%@ WebService Language="C#" Class=“MyService" %> using System; using System.Web.Services; public class MyService { [WebMethod] public String MyServiceFunction1(String strParm1, String strParm2) { ... } [WebMethod] public void MyServiceFunction2(Integer intParm) { ... } }

  22. Deploy Application • Per implementare l’applicazione web va copiato il file ASMX nel web folder.

  23. Web Application, ASPX • Per utilizzare i web services va creato un “Proxy”. • Proxies sono creati in DLL compilando il codice stub genrato dal proxy generator. • Il proxy generator genera il codice stub dal SDL che è esportato dai web services.

  24. Web Application Development Web Service Developer Web Application Developer Request SCL  Author class, ASMX Author Page that calls the Proxy Web Service : ASMX  Deploy Application Web Server Web Application : ASMX Run Method SDL ASPX Run Proxy Generator Deploy Application C#, VB Deploy Application Web Server Call Methods Web Form Proxy

  25. Request SCL + Run Proxy Generator • Creazione del codice del Proxy da SDL. • Webserviceutil /c:proxy/pa:http://hostname/MyService.asmx?SDL /l:Csharp /n:MyServices /c:proxyCrea codice del Proxy dal SDL /pa:URLSpecifica URL per il SCL(SDL) /l:languageSpecifica il linguaggio sorgente /n:namespaceSpecifica il namespace del proxy

  26. Deploy (Proxy) Application • Compila il codice generato e copia il file DLL nel web folder per implementare il proxy. • csc/out:..\bin\MyService.dll /t:library /r:system.data.dll /r:system.web.services.dll /r:system.xml.serialization.dll MyService.cs

  27.  Author ASPX <%@ Import Namespace="System.Web.UI.WebControls" %> <%@ Import Namespace=“MyServices" %> <HTML> <HEAD> <TITLE>My Service Page</TITLE> <SCRIPT LANGUAGE="C#" RUNAT="SERVER"> MyService s = new MyService(); // my service String strResult; strResult = s.MyServiceFunction1(“Hello”, “World”); s.MyServiceFunction2(12345); ...

  28. Deploy (Web) Application • Per implementare l’applicazione web va copiato il file ASPX nel web folder.

  29. The innovative feature MyService.ASPX ... <SCRIPT LANGUAGE="C#" RUNAT="SERVER"> Calendar c; SelectedDatesCollection dtSelectedPeriod; ... c = CALENDAR; ... dtSelectedPeriod = calendar.SelectedDates; ... </SCRIPT> ... <ASP:CALENDAR id="CALENDAR" runat="server" ALIGN=LEFT CellPadding="3" CellSpacing="1" DayNameFormat="FirstLetter" FirstDayOfWeek="Default" NextMonthText=">“ ... />

  30. Servizio web scheduler

  31. References [1] “Microsoft.NET”, http://www.microsoft.com/net/default.asp [2] “The simplest way to define .NET”, http://www.microsoft.com/net/defining.asp [3] “An Introduction to Microsoft Hailstorm”, http://www.microsoft.com/net/hailstorm.asp [4] “Bill Gates’ Web Site – Speeches”, http://www.microsoft.com/billgates/speeches/2001/03-19hailstorm.asp [5] “Microsoft Announces ‘Hailstorm’, a New Set of XML Web Services Designed …, http://www.microsoft.com/presspass/features/2001/mar01/03-19hailstorm.asp [6] G. Lee, “Paradigm shift in software development environment, MS Visual Studio.NET”, Microsoftware, pp. 202 ~ 213, Korea, Jan. 2001. [7] “Introduction to the Common Language Specification (CLS)”, http://msdn.microsoft.com/library/dotnet/cpapndx/_cor_introduction_to_the_common_language_specification__cls_.htm [8] “What is Common Language Specification?”, http://msdn.microsoft.com/library/dotnet/cpguide/cpconwhatiscommonlanguagespecification.htm [9] “Overview of the Common Language Runtime”, http://msdn.microsoft.com/library/dotnet/cpapndx/_cor_overview_of_the__common_language_runtime.htm

  32. References [10] “Microsoft.NET in Retail and Hospitality”, http://www.microsoft.com/technet/net/NETRetal.asp [11] “Microsoft.NET for Manufacturing: Extending the Enterprise Through Open Protocols”, http://www.microsoft.com/technet/ecommerce/netmanu.asp [12] “Microsoft .NET Platform – What it is”, http://www.microsoft.com/ISN/IndOutlook_Trends/NET_Platform_what_it_is.asp [13] “Overview of Microsoft.NET”, http://www.microsoft.com/ISN/IndOutlook_Trends/ms_net_overview.asp [14] “The Programmable Web”, http://msdn.microsoft.com/msdnmag/issues/0900/webplatform/webplatform.asp [15] “Build Web Applications Faster and Easier Using Web Services and XML”, http://msdn.microsoft.com/msdnmag/issues/0900/VSNET/VSNET.asp [16] “Sharp New Language : C# Offers the Power of C++ and Simplicity of Visual Basic”, http://msdn.microsoft.com/msdnmag/issues/0900/csharp/csharp.asp [17] G. Kim, “The announcement of Hailstorm composed of XML web services”, Microsoftware, p. 172, Korea, Apr. 2001.

More Related