Presentation is loading. Please wait.

Presentation is loading. Please wait.

Microsoft.NET Programming platform for the next decade Anders Hejlsberg Distinguished Engineer Developer Division.

Similar presentations


Presentation on theme: "Microsoft.NET Programming platform for the next decade Anders Hejlsberg Distinguished Engineer Developer Division."— Presentation transcript:

1 Microsoft.NET Programming platform for the next decade Anders Hejlsberg Distinguished Engineer Developer Division

2 Server-centric Computing Client-centric Computing XML Era Shifting decades 1980s File Sharing 1990s HTML 1970s 3270

3 1990GUI 1981PC A rich history 1995Internet MS-DOSBASIC Windows Visual BASIC IE, IIS Visual Studio XML Web Services 2000 Visual Studio.NET

4 The.NET Framework Programming platform for the next decade Natively supports XML Web Services Natively supports XML Web Services Unifies programming models Unifies programming models Dramatically simplifies development Dramatically simplifies development Provides robust execution environment Provides robust execution environment Supports multiple programming languages Supports multiple programming languages

5 Operating System Common Language Runtime Base Class Library ADO.NET and XML ASP.NET Web Forms Web Services Mobile Internet Toolkit Windows Forms Common Language Specification VBC++C#JScript… Visual Studio.NET The.NET Framework

6 Unified programming models Windows API.NET Framework Consistent API availability regardless of language and programming model ASP Server based, Stateless, Projected UI MFC/ATL Subclassing, Power, Expressiveness VB Forms RAD, Composition, Delegation

7 Simplified development Higher level of abstraction Higher level of abstraction  No low-level COM plumbing  Object-oriented to the core Unified type system Unified type system  Everything is an object, no variants, one string type, all character data is Unicode Software components Software components  Properties, methods, events, and attributes are first class constructs Seamless interoperability Seamless interoperability

8 Simplified development HWND hwndMain = CreateWindowEx( 0, "MainWinClass", "Main Window", 0, "MainWinClass", "Main Window", WS_OVERLAPPEDWINDOW | WS_HSCROLL | WS_VSCROLL, WS_OVERLAPPEDWINDOW | WS_HSCROLL | WS_VSCROLL, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, (HWND)NULL, (HMENU)NULL, hInstance, NULL); (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

9 Robust environment Automatic lifetime management Automatic lifetime management  All objects are garbage collected Exception handling Exception handling  Error handling 1 st class and mandatory Type-safety Type-safety  No unsafe casts, uninitialized variables Deployment and management Deployment and management  Assemblies, side-by-side execution  No more DLL hell!

10 Multi-language platform The.NET Platform is language neutral The.NET Platform is language neutral  All.NET languages are first class players  Complete cross-language integration  Highly leveraged tools Microsoft is providing Microsoft is providing  VB, C++, C#, Java, JScript Industry and academia Industry and academia  APL, COBOL, Eiffel, Fortran, Haskell, ML, Perl, Python, RPG, Scheme, Smalltalk, …

11 What is a Web Service? HTML == user-to-machine HTML == user-to-machine XML/SOAP == machine-to-machine XML/SOAP == machine-to-machine Leveraging the Web Leveraging the Web  Same infrastructure  Same programming model  Anyone can play Truly scalable distributed apps Truly scalable distributed apps  Stateless, loosely coupled, flexible protocol  Both Internet and Intranet

12 What is the foundation? Ubiquitous communication: Internet Universal data format:XML Universal type system:XSD Service interactions: SOAP Service descriptions: WSDL Service discovery: DISCO Directory of services: UDDI Simple, open, broad industry support

13 Discovery Let’s talk (SOAP) Let’s talk (SOAP) How does it work? http://myservice.com HTML or XML with link to WSDL How do we talk? (WSDL) http://myservice.com?wsdl XML with service descriptions http://myservice.com/svc1 XML/SOAP BODY WebService WebServiceConsumer UDDI Find a Service http://www.uddi.org Link to DISCO or WSDL document

14 Web Services with.NET Programs Objects Classes Methods Calls Web XML XSD WSDL SOAP Data Schema Services Invocation Application Concepts The.NET Framework provides a bi-directional mapping

15 public class OrderProcessor { public void SubmitOrder(PurchaseOrder order) {...} public void SubmitOrder(PurchaseOrder order) {...}} public class PurchaseOrder { public string ShipTo; public string ShipTo; public string BillTo; public string BillTo; public string Comment; public string Comment; public Item[] Items; public Item[] Items; public DateTime OrderDate; public DateTime OrderDate;} Web Services with.NET public class OrderProcessor { [WebMethod] [WebMethod] public void SubmitOrder(PurchaseOrder order) {...} public void SubmitOrder(PurchaseOrder order) {...}} [XmlRoot("Order", Namespace="urn:acme.b2b-schema.v1")] public class PurchaseOrder { [XmlElement("shipTo")] public string ShipTo; [XmlElement("shipTo")] public string ShipTo; [XmlElement("billTo")] public string BillTo; [XmlElement("billTo")] public string BillTo; [XmlElement("comment")] public string Comment; [XmlElement("comment")] public string Comment; [XmlElement("items")] public Item[] Items; [XmlElement("items")] public Item[] Items; [XmlAttribute("date")] public DateTime OrderDate; [XmlAttribute("date")] public DateTime OrderDate;} PurchaseOrder po = new PurchaseOrder(); po.ShipTo = “Anders Hejlsberg"; po.BillTo = “Bill Gates"; po.OrderDate = DateTime.Today; …OrderProcessor.SubmitOrder(order); <soap:Envelope> Anders Hejlsberg Anders Hejlsberg Bill Gates Bill Gates Overnight delivery Overnight delivery 17748933 17748933 Dom Perignon Dom Perignon </soap:Envelope>

16 Web Services demo

17 The C# language Component oriented Component oriented Unified and extensible type system Unified and extensible type system Versioning Versioning Interoperability Interoperability Pragmatic language design Pragmatic language design

18 Components What defines a component? What defines a component?  Properties, methods, events  Integrated help and documentation  Design time and run-time attributes C# has first class support C# has first class support  Not naming patterns, adapters, etc.  Not external files Components easy to build and consume Components easy to build and consume

19 Components Properties are a first class construct Properties are a first class construct public class Button: Control { private string text; private string text; public string Caption { public string Caption { get { get { return text; return text; } set { set { text = value; text = value; Repaint(); Repaint(); } }} Button b = new Button(); b.Caption = "OK"; String s = b.Caption;

20 Unified type system Traditional views of primitive types Traditional views of primitive types  C++, Java: They’re “magic”  Smalltalk, Lisp: They’re full-blown objects C# unifies with no performance cost C# unifies with no performance cost  Deep simplicity throughout system Improved extensibility and reusability Improved extensibility and reusability  New primitive types: Decimal, SQL…  Collections, etc., work for all types

21 Unified type system All types ultimately inherit from object All types ultimately inherit from object Any piece of data can be stored, transported, and manipulated with no extra work Any piece of data can be stored, transported, and manipulated with no extra work Stream MemoryStreamFileStream Hashtabledoubleint object

22 Unified type system Boxing Boxing  Allocates box, copies value into it Unboxing Unboxing  Checks type of box, copies value out int i = 123; object o = i; int j = (int)o; 123 i o 123 System.Int32 123 j

23 Unified type system Benefits Benefits  Eliminates “wrapper classes”  Collection classes work with all types  Replaces OLE Automation's Variant Lots of examples in.NET Framework Lots of examples in.NET Framework string s = string.Format( "Your total was {0} on {1}", total, date); "Your total was {0} on {1}", total, date); Hashtable t = new Hashtable(); t.Add(0, "zero"); t.Add(1, "one"); t.Add(2, "two");

24 Versioning Overlooked in most languages Overlooked in most languages  C++ and Java produce fragile base classes Pervasive versioning considerations in C# language design Pervasive versioning considerations in C# language design  Virtual methods and overriding  Overload resolution  Explicit interface implementation  const vs. readonly fields  Defaults for accessibility and virtuality

25 Versioning class Derived: Base// version 1 { public virtual void Foo() { public virtual void Foo() { Console.WriteLine("Derived.Foo"); Console.WriteLine("Derived.Foo"); }} class Derived: Base// version 2a { new public virtual void Foo() { new public virtual void Foo() { Console.WriteLine("Derived.Foo"); Console.WriteLine("Derived.Foo"); }} class Derived: Base// version 2b { public override void Foo() { public override void Foo() { base.Foo(); base.Foo(); Console.WriteLine("Derived.Foo"); Console.WriteLine("Derived.Foo"); }} class Base// version 1 {} class Base // version 2 { public virtual void Foo() { public virtual void Foo() { Console.WriteLine("Base.Foo"); Console.WriteLine("Base.Foo"); }}

26 Interoperability C# VB.NET MC++ JScript....NET Languages COM OLE Automation XML/SOAP Dynamic Link Libraries P/Invoke and unsafe code

27 Pragmatic language design C++ heritage C++ heritage  Namespaces, enums, unsigned types, etc.  Have only one way to do one thing!  Don’t make me pay every day! Real-world useful constructs Real-world useful constructs  foreach, using, switch on string  decimal type for financial applications  ref and out parameters Put the fun back in coding! Put the fun back in coding!

28 C# and CLI standardization Work begun in September 2000 Work begun in September 2000 Active involvement by Intel, HP, IBM, Fujitsu, Plum Hall, … Active involvement by Intel, HP, IBM, Fujitsu, Plum Hall, … Technical work complete Technical work complete ECMA votes this month ECMA votes this month Fast-track to ISO Fast-track to ISO

29


Download ppt "Microsoft.NET Programming platform for the next decade Anders Hejlsberg Distinguished Engineer Developer Division."

Similar presentations


Ads by Google