210 likes | 349 Views
Component-Based Software Engineering. Introduction to .NET Paul Krause. Lecture 11 - Introducing .NET. Motivation The .NET Framework CLR C# Web Services A .NET Scenario Summing Up. Motivation. “.NET is a tectonic shift for Windows developers” David Chappell - Understanding .NET
E N D
Component-Based Software Engineering Introduction to .NET Paul Krause
Lecture 11 - Introducing .NET • Motivation • The .NET Framework • CLR • C# • Web Services • A .NET Scenario • Summing Up
Motivation • “.NET is a tectonic shift for Windows developers” • David Chappell - Understanding .NET • .NET is Microsoft’s response to the: • increasing power of client side processing • increasing use of the internet as an integral part of applications • increasing threat of Java to Microsoft’s dominance
What is .NET? • Hard to be concise - in effect .NET is a brand covering a range of technologies • Key core technology is Web services • supports programmatic, rather than browser-based, access to Web applications • Although not explicitly marketed as a component technology, the idea is to access Web services via well defined interfaces • .NET components are referred to as “Assemblies”
Lecture 11 - Introducing .NET • Motivation • The .NET Framework • CLR • C# • Web Services • A .NET Scenario • Summing Up
Browser Apps Web Services Apps Local Apps Other Apps .NET Framework Class Library ASP.NET ADO.NET Windows Forms Enterprise Services More Common Language Runtime (CLR) Windows The .NET Framework
Browser Apps Web Services Apps Local Apps Other Apps Standard Java Packages Java Server Pages JDBC Swing Enterprise JavaBeans More Java Virtual Machine (JVM) Windows, Solaris, Linux, … The Java Environment
Lecture 11 - Introducing .NET • Motivation • The .NET Framework • CLR • C# • Web Services • A .NET Scenario • Summing Up
CLR • The Common Language Runtime (CLR) provides a “standard implementation” for a range of languages • Primarily C#, J#, Managed C++, JScript.NET and VisualBasic .NET • Provides common set of data types: • integers, strings, classes and interfaces • specification of how inheritance works
CLR Services • Garbage collection • Standard format for metadata • information about classes and interfaces (and other types) that is stored with the compiled code • Assemblies - a scheme for organising compiled code • can consist of DLLs, EXEs and/or compiled classes
Compiling and Running Code • Code from any of the supported languages is first compiled into MSIL • Microsoft Intermediate Language • MSIL is CPU independent • Metadata is also produced and stored in the same file as the MSIL • MSIL must then be compiled into native code for the processor on which it is running
Compilation and Execution Compilation Language Compiler Source Code MSIL and Metadata First time each method is called Execution Native Code JIT Compiler
Lecture 11 - Introducing .NET • Motivation • The .NET Framework • CLR • C# • Web Services • A .NET Scenario • Summing Up
C# • Very similar to Java in many ways: • Single inheritance • Method overriding • Exception handling • Multithreading • Multiple implementation of interfaces • But also • can directly access specific memory addresses • use of Goto statement
C# using System; class MyFirstProg { public static void Main( string [ ], args ) { Console.WriteLine(“Hello Friends”); foreach (String s in args) { Console.WriteLine(“Hi ” + s); } } }
.NET Framework Class Library System Int32, String, … Web Data Windows Enterprise Services XML … Forms XmlDocument UI Services ServicedComponent, … …
Lecture 11 - Introducing .NET • Motivation • The .NET Framework • CLR • C# • Web Services • A .NET Scenario • Summing Up
Web Services • Allows software to be accessed programatically over the Web • XML • to describe information sent • Web Services Description Language (WSDL) • specify what services are available - operations are grouped into interfaces • Simple Object Access Protocol (SOAP) • how to invoke operations in an interface • Universal Description, Discovery and Integration (UDDI) • standard registry for storing information about services
Lecture 11 - Introducing .NET • Motivation • The .NET Framework • CLR • C# • Web Services • A .NET Scenario • Summing Up
SQL Server Intranet A .NET Scenario Passport Internet .NET Profile .NET Wallet Ordering Application Shipping Application BizTalk Server Billing Application
Summing Up • .NET is a significant response to J2EE • It is locked (for the moment) to the Windows platform • It does not have the maturity of J2EE • But there are some things (Web Services) that it does better • Whatever your preference, the competition is healthy