21
Component-Based Component-Based Software Engineering Software Engineering Introduction to .NET Introduction to .NET Paul Krause Paul Krause

Component-Based Software Engineering Introduction to.NET Paul Krause

Embed Size (px)

Citation preview

Page 1: Component-Based Software Engineering Introduction to.NET Paul Krause

Component-Based Component-Based Software EngineeringSoftware Engineering

Introduction to .NETIntroduction to .NET

Paul KrausePaul Krause

Page 2: Component-Based Software Engineering Introduction to.NET Paul Krause

Lecture 11 - Lecture 11 - Introducing .NETIntroducing .NET

MotivationMotivation The .NET FrameworkThe .NET Framework CLRCLR C#C# Web ServicesWeb Services A .NET ScenarioA .NET Scenario Summing UpSumming Up

Page 3: Component-Based Software Engineering Introduction to.NET Paul Krause

MotivationMotivation

““.NET is a tectonic shift for Windows .NET is a tectonic shift for Windows developers”developers” David Chappell - Understanding .NETDavid Chappell - Understanding .NET

.NET is Microsoft’s response to the:.NET is Microsoft’s response to the: increasing power of client side processingincreasing power of client side processing increasing use of the internet as an integral part of increasing use of the internet as an integral part of

applicationsapplications increasing threat of Java to Microsoft’s dominanceincreasing threat of Java to Microsoft’s dominance

Page 4: Component-Based Software Engineering Introduction to.NET Paul Krause

What is .NET?What is .NET?

Hard to be concise - in effect .NET is a brand Hard to be concise - in effect .NET is a brand covering a range of technologiescovering a range of technologies

Key core technology is Key core technology is Web servicesWeb services supports supports programmaticprogrammatic, rather than browser-, rather than browser-

based, access to Web applicationsbased, access to Web applications Although not explicitly marketed as a Although not explicitly marketed as a

component technology, the idea is to access component technology, the idea is to access Web services via well defined interfacesWeb services via well defined interfaces .NET components are referred to as “Assemblies”.NET components are referred to as “Assemblies”

Page 5: Component-Based Software Engineering Introduction to.NET Paul Krause

Lecture 11 - Lecture 11 - Introducing .NETIntroducing .NET

MotivationMotivation The .NET FrameworkThe .NET Framework CLRCLR C#C# Web ServicesWeb Services A .NET ScenarioA .NET Scenario Summing UpSumming Up

Page 6: Component-Based Software Engineering Introduction to.NET Paul Krause

The .NET FrameworkThe .NET Framework

Windows

Common Language Runtime (CLR)

.NET Framework Class Library

ASP.NET ADO.NET WindowsForms

EnterpriseServices

More

BrowserApps

Web ServicesApps

LocalApps

OtherApps

Page 7: Component-Based Software Engineering Introduction to.NET Paul Krause

The Java EnvironmentThe Java Environment

Windows, Solaris, Linux, …

Java Virtual Machine (JVM)

Standard Java Packages

Java ServerPages

JDBC Swing EnterpriseJavaBeans

More

BrowserApps

Web ServicesApps

LocalApps

OtherApps

Page 8: Component-Based Software Engineering Introduction to.NET Paul Krause

Lecture 11 - Lecture 11 - Introducing .NETIntroducing .NET

MotivationMotivation The .NET FrameworkThe .NET Framework CLRCLR C#C# Web ServicesWeb Services A .NET ScenarioA .NET Scenario Summing UpSumming Up

Page 9: Component-Based Software Engineering Introduction to.NET Paul Krause

CLRCLR

The Common Language Runtime (CLR) The Common Language Runtime (CLR) provides a “standard implementation” for a provides a “standard implementation” for a range of languagesrange of languages Primarily C#, J#, Managed C++, JScript.NET and Primarily C#, J#, Managed C++, JScript.NET and

VisualBasic .NETVisualBasic .NET Provides common set of data types:Provides common set of data types:

integers, strings, classes and interfacesintegers, strings, classes and interfaces specification of how inheritance worksspecification of how inheritance works

Page 10: Component-Based Software Engineering Introduction to.NET Paul Krause

CLR ServicesCLR Services

Garbage collectionGarbage collection Standard format for metadataStandard format for metadata

information about classes and interfaces (and information about classes and interfaces (and other types) that is stored with the compiled codeother types) that is stored with the compiled code

Assemblies - a scheme for organising Assemblies - a scheme for organising compiled codecompiled code can consist of DLLs, EXEs and/or compiled can consist of DLLs, EXEs and/or compiled

classesclasses

Page 11: Component-Based Software Engineering Introduction to.NET Paul Krause

Compiling and Running CodeCompiling and Running Code

Code from any of the supported languages is Code from any of the supported languages is first compiled into MSILfirst compiled into MSIL Microsoft Intermediate LanguageMicrosoft Intermediate Language

MSIL is CPU independentMSIL is CPU independent Metadata is also produced and stored in the same Metadata is also produced and stored in the same

file as the MSILfile as the MSIL MSIL must then be compiled into native code MSIL must then be compiled into native code

for the processor on which it is runningfor the processor on which it is running

Page 12: Component-Based Software Engineering Introduction to.NET Paul Krause

Compilation and ExecutionCompilation and Execution

SourceCode

MSIL andMetadata

Language Compiler

Compilation

Native CodeJIT

Compiler

Execution

First time each

method is called

Page 13: Component-Based Software Engineering Introduction to.NET Paul Krause

Lecture 11 - Lecture 11 - Introducing .NETIntroducing .NET

MotivationMotivation The .NET FrameworkThe .NET Framework CLRCLR C#C# Web ServicesWeb Services A .NET ScenarioA .NET Scenario Summing UpSumming Up

Page 14: Component-Based Software Engineering Introduction to.NET Paul Krause

C#C#

Very similar to Java in many ways:Very similar to Java in many ways: Single inheritanceSingle inheritance Method overridingMethod overriding Exception handlingException handling MultithreadingMultithreading Multiple implementation of interfacesMultiple implementation of interfaces

But alsoBut also can directly access specific memory addressescan directly access specific memory addresses use of Goto statementuse of Goto statement

Page 15: Component-Based Software Engineering Introduction to.NET Paul Krause

C#C#

using System;using System;

class MyFirstProg {class MyFirstProg {public static void Main( string [ ], args ) {public static void Main( string [ ], args ) {

Console.WriteLine(“Hello Friends”);Console.WriteLine(“Hello Friends”);foreach (String s in args) {foreach (String s in args) {

Console.WriteLine(“Hi ” + s);Console.WriteLine(“Hi ” + s);}}

}}}}

Page 16: Component-Based Software Engineering Introduction to.NET Paul Krause

.NET Framework Class Library.NET Framework Class Library

System

Int32, String,…

Web Data WindowsEnterpriseServices

XML …

XmlDocument

ServicedComponent, …

Forms

ServicesUI

Page 17: Component-Based Software Engineering Introduction to.NET Paul Krause

Lecture 11 - Lecture 11 - Introducing .NETIntroducing .NET

MotivationMotivation The .NET FrameworkThe .NET Framework CLRCLR C#C# Web ServicesWeb Services A .NET ScenarioA .NET Scenario Summing UpSumming Up

Page 18: Component-Based Software Engineering Introduction to.NET Paul Krause

Web ServicesWeb Services Allows software to be accessed programatically over Allows software to be accessed programatically over

the Webthe Web XMLXML

to describe information sentto describe information sent Web Services Description Language (WSDL)Web Services Description Language (WSDL)

specify what services are available - operations are grouped specify what services are available - operations are grouped into interfacesinto interfaces

Simple Object Access Protocol (SOAP)Simple Object Access Protocol (SOAP) how to invoke operations in an interfacehow to invoke operations in an interface

Universal Description, Discovery and Integration (UDDI)Universal Description, Discovery and Integration (UDDI) standard registry for storing information about servicesstandard registry for storing information about services

Page 19: Component-Based Software Engineering Introduction to.NET Paul Krause

Lecture 11 - Lecture 11 - Introducing .NETIntroducing .NET

MotivationMotivation The .NET FrameworkThe .NET Framework CLRCLR C#C# Web ServicesWeb Services A .NET ScenarioA .NET Scenario Summing UpSumming Up

Page 20: Component-Based Software Engineering Introduction to.NET Paul Krause

Internet

A .NET ScenarioA .NET ScenarioPassport

.NET Profile

.NET Wallet

SQL

Server

BillingApplication

OrderingApplication

BizTalkServer

ShippingApplication Intrane

t

Page 21: Component-Based Software Engineering Introduction to.NET Paul Krause

Summing UpSumming Up

.NET is a significant response to J2EE.NET is a significant response to J2EE It is locked (for the moment) to the Windows It is locked (for the moment) to the Windows

platformplatform It does not have the maturity of J2EEIt does not have the maturity of J2EE But there are some things (Web Services) that But there are some things (Web Services) that

it does betterit does better Whatever your preference, the competition is Whatever your preference, the competition is

healthyhealthy