Distributed Objects Technologies: .NET and CORBA

36
Distributed Objects Technologies: .NET and CORBA Naim R. El-Far, PhD Candidate TA for SEG3202 Software Design and Architecture with N. El-Kadri (Summer 2005) Tutorial 4 of 4 – 24/6/2005

description

Distributed Objects Technologies: .NET and CORBA. Naim R. El-Far , PhD Candidate TA for SEG3202 Software Design and Architecture with N. El-Kadri (Summer 2005) Tutorial 4 of 4 – 24/6/2005. About Today’s Material. - PowerPoint PPT Presentation

Transcript of Distributed Objects Technologies: .NET and CORBA

Page 1: Distributed Objects Technologies: .NET and CORBA

Distributed Objects Technologies:

.NET and CORBANaim R. El-Far, PhD Candidate

TA for SEG3202 Software Design and Architecture with N. El-Kadri (Summer 2005)

Tutorial 4 of 4 – 24/6/2005

Page 2: Distributed Objects Technologies: .NET and CORBA

About Today’s Material

Some of today’s material has been adapted from presentations by D. Schmitt of Microsoft, and Dr. I. Stoica of UC Berkeley.

Page 3: Distributed Objects Technologies: .NET and CORBA

In Perspective

1. Client/Server Architecture (Tutorial 1)2. N-Tier Architecture (Tutorial 2)3. Concept of Distributed Objects (Tutorial

3)4. Technologies for Distributing Objects

Java RMI J2EE (Tutorial 3).NET (Today’s tutorial)CORBA (Today’s tutorial)

Page 4: Distributed Objects Technologies: .NET and CORBA
Page 5: Distributed Objects Technologies: .NET and CORBA

.NET Enterprise Vision

SchedulingAuthentication

Notification

ERP & Billing

Customer Operations Sales Supply Engineering

CustomerService

Plant Operations

UsersAny device,Any place,Any time

Roles/ExperiencesGet the right infoTo the right userAt the right time

XML Web ServicesIntegrate and orchestrate business applications and processes

Back OfficeHeterogeneous application and server infrastructure

Page 6: Distributed Objects Technologies: .NET and CORBA

What is .NET?

A generic term for the MS vision The successor to Windows DNA Sometimes applied to product names

Such as Windows .NET ServerA specific software framework

Includes a common runtime Common across OS and dev language

Includes baseline dev tools in an SDK Includes powerful dev environment

Visual Studio .NET

Page 7: Distributed Objects Technologies: .NET and CORBA

.NET Workings

An evolution from COM/DCOM Windows DNA .NET Platform-independent Internet integration Security

Primary Components Common Language Infrastructure (CLI): specifications

for a runtime environment, including a common type system, base class library, and a machine-independent intermediate code known as the Common Intermediate Language (CIL) – MSIL.

Common Language Runtime (CLR): Runtime environment to run any CIL code that adheres to CLI specs usually through JIT compilation.

Page 8: Distributed Objects Technologies: .NET and CORBA

.NET Workings All CIL is self-describing through .NET metadata. Language implementation CIL CLR MSIL .NET

languages .NET assemblies, DLL or EXE for Win32. The .NET unit of

deployment, versioning and security (64 bit public/private key). All code is compiled, not interpreted

Converted to native machine code at install time (via NGEN) or run time (via JIT compiler)

Static code management Versioning, localizing, and signing Configurable assembly resolver Global assembly cache (GAC)

Dynamic code management Memory allocation with garbage collection Lifecycle management via reference tracking Thread pooling

Page 9: Distributed Objects Technologies: .NET and CORBA

.NET Workings

Fine-grained code access security Augments OS security (user credentials) Ensures that code only performs operations allowed by policies

set by user or administrator Based on code source, publisher signature, and other evidence

Flexible deployment Simple XCOPY (since not bound to Windows registry) Windows installer Auto-deploy (aka no-touch or zero-impact)

Flexible remoting Includes XML/SOAP and binary Remoting model is easily extended Integrates with web services

Page 10: Distributed Objects Technologies: .NET and CORBA

ExecutionExecution

CodeCode

MetadataMetadata

Compilation & Execution

CompilationCompilation

Before Before installation or installation or the first time the first time

each method is each method is calledcalled

JIT JIT CompilerCompiler

NativeNativeCodeCode

Source Source CodeCode

Language Language CompilerCompiler

AssemblyUnit of deployment,

similar to DLL or EXE with added metadata

Saved in cacheAn assembly can also

be pre-compiled as part of deployment

Page 11: Distributed Objects Technologies: .NET and CORBA

CLR Internals

Class LoaderClass Loader

IL to NativeIL to NativeCompilersCompilers

CodeCodeManagerManager

GarbageGarbageCollectorCollector

Security ServicesSecurity Services Debug ServicesDebug Services

Type CheckerType Checker Exception ManagerException Manager

Thread ManagerThread Manager COM MarshalerCOM Marshaler

Base Class LibraryBase Class Library

Page 12: Distributed Objects Technologies: .NET and CORBA

C#C# VBVB

ASP.NET ADO.NET Enterprise Services

CLR

MSMQMSMQ COM+COM+ ActiveActiveDirectoryDirectory IISIIS WMIWMI

Win32Win32

.NET Structure: CLR and Win32 Services

J#...J#... Same class library across all programming

languages

Connects .NET to COM+ for transactional

components and other enterprise services

Connects .NET to data providers, including

XML documents

Provides WebForms for thin clients, plus web

services via HTTP

Page 13: Distributed Objects Technologies: .NET and CORBA

.NET Framework: More generally

Page 14: Distributed Objects Technologies: .NET and CORBA

.NET Framework

WindowsWindows

Standard .NETStandard .NETFrameworkFramework

WindowsWindows Framework ExtensionsFramework Extensions

Other Other FrameworkFrameworkExtensionsExtensions

Framew

ork Fram

ework

FeaturesFeatures

Application Reach across DevicesApplication Reach across Devices

Other OSOther OS

InternetInternet and Web Servicesand Web Services

Page 15: Distributed Objects Technologies: .NET and CORBA

.NET Mobility Framework

Windows CEWindows CE

.NET Compact .NET Compact FrameworkFramework

Windows CE Windows CE Framework ExtensionsFramework Extensions

Device Vendor Device Vendor FrameworkFrameworkExtensionsExtensions

Framew

ork Fram

ework

FeaturesFeatures

Application Reach across DevicesApplication Reach across Devices

Other OSOther OS

InternetInternet and Web Servicesand Web Services

Page 16: Distributed Objects Technologies: .NET and CORBA

.NET on non-MS Operating Systems

Microsoft’s Shared Source Initiative: Rotor: Microsoft shared-source version of .NET

for FreeBSD Mono: Novell (formerly by Ximian) open-source

version of .NET for GNU/Linux, UNIX, Mac OS X, and Windows based computers.

Portable .NET: is part of the DotGNU project.

Page 17: Distributed Objects Technologies: .NET and CORBA
Page 18: Distributed Objects Technologies: .NET and CORBA

Introduction to CORBA Common Object Request Broker Architecture (CORBA) A standard for software componentry. Created and controlled by the Object Management Group (OMG). Defines APIs, communication protocol, and object/service information models

to enable heterogeneous applications written in various languages running on various platforms to interoperate platform and location transparency for sharing well-defined objects across a distributed computing platform.

CORBA "wraps" code written in some language into a bundle containing additional information on the capabilities of the code inside, and how to call it. The resulting wrapped objects can then be called from other programs (or CORBA objects) over the network.

CORBA can be considered as a machine-readable documentation format. Interface Definition Language (IDL) to specify the interfaces that objects will

present to the world. A "mapping" from IDL to a specific implementation language like C++ or

Java. Standard mappings exist for Ada, C, C++, Lisp, Smalltalk, Java, and Python. There are also non-standard mappings for Perl and Tcl implemented by ORBs written for those languages.

Page 19: Distributed Objects Technologies: .NET and CORBA

High-Level Overview of CORBA CORBA applications are composed of objects. For each object type you define an interface in OMG IDL. CORBA = Separation of interface from implementation.

Well-defined, strict interfaces. Hidden implementation. Clients access objects only through their advertised interface.

Page 20: Distributed Objects Technologies: .NET and CORBA

CORBA Architecture

ORB

C++ Object

Client Server

Java Object

IIOPORB

Stub Object Adapter

Skeleton

Page 21: Distributed Objects Technologies: .NET and CORBA

Stub

Provides interface between client object and ORB

Marshalling: client invocationUnmarshalling: server response

ORB

C++ Object

Client Server

Java Object

IIOPORB

Stub Object Adapter

Skeleton

Page 22: Distributed Objects Technologies: .NET and CORBA

Skeleton

Provides iterface between server object and ORB

Unmarshaling: client invocationMarshaling: server response

ORB

C++ Object

Client Server

Java Object

IIOPORB

Stub Object Adapter

Skeleton

Page 23: Distributed Objects Technologies: .NET and CORBA

(Portable) Object Adapter (POA)

Register class implementationsCreates and destroys objects Handles method invokationHandles client authentication and access control

ORB

C++ Object

Client Server

Java Object

IIOPORB

Stub Object Adapter

Skeleton

Page 24: Distributed Objects Technologies: .NET and CORBA

Object Request Broker (ORB)

Communication infrastructure sending messages between objects

Communication type: GIOP (General Inter-ORB Protocol) IIOP (Internet Inter-ORB Protocol) (GIOP on TCP/IP)

ORB

C++ Object

Client Server

Java Object

IIOPORB

Stub Object Adapter

Skeleton

Page 25: Distributed Objects Technologies: .NET and CORBA

CORBA Object

Server

InterfaceIDL

C++/JavaImplementation

Interoperable Object ReferenceCORBA

Object

Servant

Page 26: Distributed Objects Technologies: .NET and CORBA

Example of CORBA Services

Naming: Keeps track of association between object names and their reference. Allows ORB to locate referenced objects

Life Cycle: Handles the creation, copying, moving, and deletion objects

Trader: A “yellow pages” for objects. Lets you find them by the services they provide

Event: Facilitates asynchronous communications through events

Concurrency: Manages locks so objects can share resources

Query: Locates objects by specified search criteria

Page 27: Distributed Objects Technologies: .NET and CORBA

Remote Invocation in CORBA

Oversimplification: Client first obtains its object reference (E.g. Naming Service and the Trader

Service). Remote invocation = local invocation + substituting the object reference for

the remote instance. ORB examines the object reference and discovers that the target object is

remote routes the invocation out over the network to the remote object's ORB.

Page 28: Distributed Objects Technologies: .NET and CORBA

Remote Invocation in CORBA

In more detail: IDL the client knows exactly which operations

it may invoke, what the input parameters are, and where they have to go in the invocation

IIOP (ORBs may use other protocols) Although the ORB can tell from the object

reference that the target object is remote, the client can not.

Page 29: Distributed Objects Technologies: .NET and CORBA

Object Invocation Models

Invocation models supported in CORBA

Request type Failure semantics DescriptionSynchronous At-most-once Caller blocks until a

response is returned or an exception is raised

One-way Best effort delivery Caller continues immediately without waiting for any response from the server

Deferred synchronous

At-most-once Caller continues immediately and can later block until response is delivered

Page 30: Distributed Objects Technologies: .NET and CORBA

Interoperability

Allow multi-vendor ORB implementations to communicate with each other

General Inter-ORB Protocol (GIOP) message types

Message type Originator Description

Request Client Contains an invocation request

Reply Server Contains the response to an invocation

LocateRequest Client Contains a request on the exact location of an object

LocateReply Server Contains location information on an object

CancelRequest Client Indicates client no longer expects a reply

CloseConnection Both Indication that connection will be closed

MessageError Both Contains information on an error

Fragment Both Part (fragment) of a larger message

Page 31: Distributed Objects Technologies: .NET and CORBA

Object References

The organization of an IOR with specific information for IIOP

Page 32: Distributed Objects Technologies: .NET and CORBA

Secure Object Invocation in CORBA

Page 33: Distributed Objects Technologies: .NET and CORBA

CORBA Application

1) Define interface using IDL2) Compile interface3) Implement interface4) Instantiate server:

• Register object as a CORBA object

5) Instantiate client:• Invoke CORBA object

• Example using a Java client and server

Page 34: Distributed Objects Technologies: .NET and CORBA
Page 35: Distributed Objects Technologies: .NET and CORBA

J2EE vs. .NET

Cola vs. Pepsi Are you starting from scratch? Are you migrating from a legacy system? One day, J2EE and .NET will become “legacy”

systems. Past, Present, and Future. Web Services Body Organs For more details (a little out of date by

comprehensive: http://www.theserverside.com/articles/article.tss?l=J2EE-vs-DOTNET)

Page 36: Distributed Objects Technologies: .NET and CORBA

Where does CORBA fit it?

Purpose of CORBAIIOP, a pillar of CORBAJ2EE support for IIOP.NET support for IIOP (IIOP.NET, Janeva)CORBA, J2EE, and .NET: like everything

else, the mix depends on your purpose, the past, the present, and the future of your system.