CORBA, DCOM and Java

142
CORBA, DCOM and Java V. “Juggy” Jagannathan CareFlow|Net, Inc.

description

CORBA, DCOM and Java. V. “Juggy” Jagannathan CareFlow|Net, Inc. CORBA. Distributed Object Infrastructure. References. Robert Orfali, Dan Harkey, “Client/Server Programming with Java and CORBA, Second Edition.” John Wiley and Sons, 1998. - PowerPoint PPT Presentation

Transcript of CORBA, DCOM and Java

Page 1: CORBA, DCOM and Java

CORBA, DCOM and Java

V. “Juggy” JagannathanCareFlow|Net, Inc.

Page 2: CORBA, DCOM and Java

CORBA

Distributed Object

Infrastructure

Page 3: CORBA, DCOM and Java

References

Robert Orfali, Dan Harkey, “Client/Server Programming with Java and CORBA, Second Edition.” John Wiley and Sons, 1998.

Andreas Vogel and Keith Duddy, “Java Programming with CORBA, Second Edition, Advanced Techniques for Building Distributed Applications,” John Wiles and Sons, 1998.

John Siegal (written and edited by), “CORBA Fundamentals and Programming,” John Wiley and Sons, 1996.

Page 4: CORBA, DCOM and Java

Outline

Overview CORBA 1.1, 2.0, 3.0 IDL and Interface Repository CORBA services

Page 5: CORBA, DCOM and Java

Background*

Not-for-profit company based in United States, with representation in Italy, United Kingdom, Germany, Japan, Australia & India.

Founded April 1989. Small staff (35 full time); no internal

development. Almost all technical work done by

engineers in member companies Almost 800 members (4/98)

* Viewfoil courtesy OMG: http://www.omg.org/library/diego.ppt

Page 6: CORBA, DCOM and Java

Worldwide Scope *

Andersen

APM

Alta

AITECH

AT&T

BaaN

Bull

British Telecom

Bankers Trust

Data Access

Eurocontrol

EDS

Ericsson

FinSiel

Fujitsu

Genesis

HP

Harlequin

ICL

Informix

Intel

IBM

IONA Tech.

Microsoft

MITRE

Netscape

Sun Microsystems

Sybase

Thomson CSF

Telecom Italia

Telefonica

Telia AB

TRW

Unisys

Valtech…….

Nortel

Novell

OHRA Insurances

Oracle

Open Group

POSC

Sodalia

Siemens Nixdorf

Software AG

* Viewfoil courtesy OMG: http://www.omg.org/library/diego.ppt

Page 7: CORBA, DCOM and Java

Adoption Process *

RFI (Request for Information) to establish range of commercially available software.

RFP (Request for Proposals) to gather explicit descriptions of available software; Architecture Board approves.

Letters of Intent to establish corporate direction. Task Force evaluation & recommendation;

simultaneous evaluation by Business Committee. Architecture Board consideration for consistency. Board decision based on recommendations from

the appropriate Technology Committee & Business Committee.

Fast Track Process.

* Viewfoil courtesy OMG: http://www.omg.org/library/diego.ppt

Page 8: CORBA, DCOM and Java

Integration Technology - CORBA

The Common Object Request Broker Architecture is the standard adopted by OMG as a framework to provide common ORB services and interfaces to support portable clients and services.

The Object Request Broker (ORB) provides the mechanisms by which clients transparently make requests and receive responses.

Page 9: CORBA, DCOM and Java

CORBA (continued)

Advantages offered by CORBA: architecture independence language independence location independence

The standard specifies the Interface

Definition Language (IDL) - language used to

describe the interfaces that client objects

call and object implementations provide.

Page 10: CORBA, DCOM and Java

De-facto Standards and products available*

CORBA 2 (IIOP)

- ORBIX - IONA- Obj Broker BEA- VisiBroker Borland- Omni Orb Olivetti- Component Broker IBM

CORBAservices- Naming- Security (...ICL)- Transactions (..Bull)- Query Service- Persistence- Lifecycle

CORBAfacilities

- Architecture guide and roadmap- Working on Internet facilities.

CORBAdomains

- Manufacturing:- Electronic Commerce:- Healthcare:-Telecommunications:- Finance-Transportation- …..

CORBA applications

* Viewfoil courtesy OMG: http://www.omg.org/library/diego.ppt

Page 11: CORBA, DCOM and Java

* Adapted from Orafali and Harkey’s Book

The Evolution of CORBA*

CORBA 1.1 (1992) Basic ORB, IR, BOA, C Bindings, Naming, Events,

Lifecycle etc.

CORBA 2.0 (1995) IIOP, Federated IR, C++ Bindings, Transactions,

Concurrency, Externalization, Relationships, Query, Licensing, Trader, Security, Collections, Time etc.

CORBA 3.0 (1999) Messaging (MOM), Server Portability (POA), Business

Objects (JavaBeans), Java Bindings, Objects-by-value, CORBA/DCOM, IIOP Firewall, Workflow, Domain-level Frameworks, Mobile Agents etc.

Page 12: CORBA, DCOM and Java

ORB services

Multiple language bindings - C, C++, Java, Smalltalk, Ada, Cobol

Interface Repository stores the interface specifications of all services

Transparency of object location

Page 13: CORBA, DCOM and Java

ORB services - Contd

Object-oriented - provides for encapsulation, polymorphism and inheritance

Can provide security for content and context-sensitive transactions

Page 14: CORBA, DCOM and Java

Common Object Service Specification

1(COSS1)

Life cycle service - for instantiating, copying, moving and deleting objects

Persistence service - interface for storing objects - relational and OODBMS backends - Deprecated.

Naming service - to locate using OSF DCE, Sun NIS or X.500 naming conventions. Can work with Internet standards such as LDAP.

Event Service - dynamically register interest in events - using a global object called event channel

Page 15: CORBA, DCOM and Java

COSS2

Concurrecny control service - to provide for locking

Transaction service - to provide for two-phase commit coordination

Relationship service - to connect and group multiple objects

Externalization service - to export and interchange data

Page 16: CORBA, DCOM and Java

COSS3

Security Time management

Page 17: CORBA, DCOM and Java

CORBA Architecture

ServersServers

ORB

C++ JavaAda otherC C++ JavaAda otherC

ClientsClients ServerServer

Client RequestsClient RequestsIDL-based

ServiceServiceIDL-based

Page 18: CORBA, DCOM and Java

COSS4

Query service - it is a superset of SQL based on the Object Database Management Group (ODMG)

Licensing service - to support metering and support for payment for use of components

Properties service - to associate dynamic properties with components

Page 19: CORBA, DCOM and Java

COSS5

Trader Collections Change management

Page 20: CORBA, DCOM and Java

CORBA 2.0

Adds multivendor ORB interoperability to CORBA 1.1

specifications adopted in 1991

An ORB mediates requests for services from client

applications and service providers

Page 21: CORBA, DCOM and Java

Client/Server Request Using the

ORB 2.0

Object Request Broker

DyamicInvoc-ation

Client IDL

Stubs

ORBInter-face

Client

InterfaceRepository

ImplementationRepository

StaticSkeletons

DynamicSkeletons

Object Adapter

ObjectImplementations

Page 22: CORBA, DCOM and Java

Client IDL Stubs

Provides local proxies for remote services

Provides for marshaling of parameters into standard formats

Page 23: CORBA, DCOM and Java

Dynamic Invocation Interface

Late binding of method calls Run time discovery of service IDL

interface

Page 24: CORBA, DCOM and Java

Interface Repository

Runtime database of interfaces of all registered objects

Supports the query of, registration of, and update of interfaces of objects mediated by the ORB

Repository IDs - uniquely and globally identify interface repository across multivendor ORBs

Page 25: CORBA, DCOM and Java

ORB Interface

Provides for API that provide a number of utilities: Object-to-string : converts object reference to a string String-to-object : converts a string reference to object get-interface : to find the location of interface

repository for a given object get-implementation: to find the reference to

implementation repository of an object

Page 26: CORBA, DCOM and Java

Server IDL Stubs

Also called skeletons provide static interfaces to each service

provided both client side and server side stubs are

generated using IDL compilers

Page 27: CORBA, DCOM and Java

Dynamic Skeleton Interface (DSI)

to implement dynamic services or dynamically changing services

run-time binding of new services using scripting languages and interpreters

to redirect messages to objects for which a compiled idl-interface is not known

Page 28: CORBA, DCOM and Java

Object Adapter

responsible for managing a collection of server objects

instantiates server objects when needed and provides them with object IDs called object references

registers the classes and instances in the Implementation Repository

All CORBA implementations must support a Basic Object Adapter

Page 29: CORBA, DCOM and Java

Implementation Repository

Keeps track of classes and run-time instances of server objects supported by the ORB

Allows for mechanisms to support audit trails, trace information and security related infrastructure

Page 30: CORBA, DCOM and Java

Using the Static interface

Definition of object services using IDL Precompiler generates server and client stubs Implementation code added to the server stubs Compilation: client stubs, server stubs, code that

implements server classes and code to describe the classes to Interface Repository

Register with Interface Repository Instantiate server objects Register run time instances with Implementation

Repository

Page 31: CORBA, DCOM and Java

Using the Dynamic interface

Lookup service name and get its interface specification from Interface Repository

Put together a request made up of object reference, method name and argument list

Invoke the method call on the desired object

Page 32: CORBA, DCOM and Java

Basic Object Adapter

Must provide for the following functionality: An implementation repository Manage instantiation and destruction of objects Manage object references and invoking methods Mechanism to authenticate clients

Page 33: CORBA, DCOM and Java

BOA Object Activation Alternatives

Shared Server: First time call to any object causes the server process to startup. Future requests are handled by the server directly. BOA notified with impl_is_ready and deactivate_impl.

Unshared Server: A new server process is started to support each object requests.

Server-per-method: A new server process is started for each request made (method call).

Persistent server: Servers are persistent and started independently.

Page 34: CORBA, DCOM and Java

CORBA 2.0 Interoperability

Standard

CORBA 1.1 allowed for portability CORBA 2.0 specifies the Internet Inter-

ORB Protocol (IIOP) Public domain IIOPs are now available

(from Sun for instance) Every CORBA-compliant ORB must

implement IIOP or provide a half bridge to it

Page 35: CORBA, DCOM and Java

General Inter-ORB Protocol (GIOP)

Common Data Representations (CDR) used in

communications

CDR maps data types defined using IDL into a flat

representation for use in network layer

CDR takes care of inter-platform issues such as byte

ordering

Specifies Interoperable Object References for use in multi-

vendor ORB environments

Page 36: CORBA, DCOM and Java

Internet Inter-ORB Protocol (IIOP)

Standardizes the way GIOP messages can

be exchanged using TCP/IP

Mandatory for CORBA 2.0 compliance

Page 37: CORBA, DCOM and Java

Environment-Specific Inter-ORB Protocols (ESIOPs)

Example is DCE/ESIOP

GIOP CDR-based messages defined using OMG IDL are

transported using DCE RPC using DCE native Network

Data Representation (NDR)

Page 38: CORBA, DCOM and Java

ORB-to-ORB Bridging

Client Server

DSI DII

ORB From Vendor A ORB From Vendor B

Page 39: CORBA, DCOM and Java

IDL and Interface Repository

Interface Definition Language (IDL): fundamental mechanism supported by all ORBs to separate interfaces and implementations

Interface Repository is a queriable and updateable runtime information store of interface specification generated from IDL

Page 40: CORBA, DCOM and Java

IDL users

Client programmers who want to access the services

provided by an object - they need the IDL to determine

how to call the services

Server programmers who want to extend the service

provided - they need the IDL to subclass and provide

additional capabilities

Page 41: CORBA, DCOM and Java

IDL Structure

Module: groups a collection of class definitions (interfaces)

Interface: defines a class; attributes and exceptions

Operation: defines a method; the arguments; argument types; in, out or in-out; exceptions; optional context description

Data types: basic (short , float, char...) and constructed

Page 42: CORBA, DCOM and Java

IDL Example : type codes

typedef string Date_T;

typedef string PersonID_T;

typedef string Address_T;

typedef char MaritalStatus_T;

typedef char Sex_T;

typedef long PolicyID_T;

Page 43: CORBA, DCOM and Java

IDL Example: Interfaces

interface FamilyMember;

interface Employer;

interface InsurancePolicy;

interface InsuranceCompany;

Page 44: CORBA, DCOM and Java

IDL Example: Interface definition

interface Demographics: PRObject

{

readonly attribute PersonID_T personID;

attribute string lastName;

attribute string firstName;

attribute long SSN;

attribute Date_T DOB;

attribute string birthPlace;

attribute MaritalStatus_T maritalStatus;

readonly attribute sequence<InsurancePolicy> insurancePolicies;

readonly attribute sequence<FamilyMember> familyMembers;

readonly attribute sequence<Employer> employers;

};

Page 45: CORBA, DCOM and Java

IDL Example: Interface definition

interface InsurancePolicy: PRObject

{

readonly attribute PolicyID_T policyID;

attribute string insuranceType;

attribute string carrierProgram;

attribute long groupNo;

attribute long payorNo;

attribute long controlNo;

attribute string relationshipToPolicyHolder;

readonly attribute Demographics policyHolder;

readonly attribute InsuranceCompany insuranceCompany;

};

Page 46: CORBA, DCOM and Java

Type Codes

represent IDL-defined data types

provide for self-describing data

Used by: DII, IIOP, Interface Repositories and any data

type

Page 47: CORBA, DCOM and Java

Interface Repository - where used

Run-time type checking on method invocation

parameters

Connecting multi-vendor ORBs

Support dynamic discovery of object interfaces and

support for DII

Provide for self-describing objects

Page 48: CORBA, DCOM and Java

CORBA 3.0

Trader Service

POA

Workflow

Business Objects Facility

CORBA Component Model

CORBA Scripting Language

IIOP over firewall

Java to IDL mapping

Real-time CORBA

Asynchronous Messaging

Domain-specific frameworks Manufacturing,

Transportation, Finance, Healthcare, Telecom, Electronic Commerce

and more!

See: http://www.omg.org/news/pr98/9_9.htm for a press releaseon CORBA 3.0 by major vendors for an early 1999 commercial availability.

Page 49: CORBA, DCOM and Java

Trader Service

Naming Service is like white pages

Trader is like yellow pages

ORB

ORB

Trader

Server“Exporter”

ORB

Client“Importer”

Export ServiceImport Service

Invoke Service

Page 50: CORBA, DCOM and Java

Portable Object Adapter (POA)

To quote Orafali & Harkey: “The POA is simply the BOA done right.”Similar to BOA, POA supports management of:

separate process for each method separate process for each object shared process for multiple objects

In addition, POA supports the notions of: servants and servant managers (instance managers) transient and persistent servants and instances

Essentially addresses scalability and flexibility in server implementations

Page 51: CORBA, DCOM and Java

CORBA/Java Security

Reference: Andreas Vogel & Keith Duddy, “Java Programming With CORBA,” Second Edition, John Wiley & Sons, 1998.

Page 52: CORBA, DCOM and Java

Applet Security Issues

Java Virtual Machine for applet execution are restricted in their ability to access local resources - referred to as “applet sandboxing.”

Applets are only allowed to communicate with the server they are downloaded from

CORBA clients can in principle communicate with any object for which there is an IOR reference.

Two approaches have been identified to address applet security restrictions.

Page 53: CORBA, DCOM and Java

Working with Applet Security

restrictions Establish an IIOP

gateway which serves as a proxy to the real server

Use signed applets

WWW Server

IIOP Gateway

ServerImplementation

Browser

ClientApplet

DownloadApplet

IIOP IIOP

Page 54: CORBA, DCOM and Java

Firewalls

Firewalls restrict and filter network traffic

In a client-server environment, in the general case, there may be a client-side and a server-side firewall involved.

Client side

Server side

Page 55: CORBA, DCOM and Java

Types of firewalls

Origin/Destination Filtering - router-based filtering based on IP address of target and

specific port numbers on that address filtering based on IP addresses of specific set of

source machines

Gateway firewall A machine with dual network cards - one

connects to Internet and the other to Intranet. Only way for packet traffic to bridge the two

networks is a protocol-specific bridge that forwards packets to the appropriate applications

Page 56: CORBA, DCOM and Java

Client-side firewalls

Gatekeeper

ServerImplementation

Browser

ClientApplet

HTTP IIOP

Client-sideFirewall

HTTP Tunneling With Gatekeeper

Proxy

Gatekeeper

ServerImplementation

Browser

ClientApplet

IIOP IIOP

Client-sideFirewall

Gatekeeper with dual functionality

Proxy

HTTPPort 80

Page 57: CORBA, DCOM and Java

IIOP over Secure Socket Layer (SSL)

SSL is layered on top of TCP/IP It is the basis for secure electronic

commerce over the Web - using Secure HTTP (SHTTP)

SSL authentication is based on public key cryptography

Authentication is based on digitally signed certificates.

Page 58: CORBA, DCOM and Java

Overview of CORBA Security

Service

Page 59: CORBA, DCOM and Java

Goals of a security service

Confidentiality Integrity Accountability Availability

Page 60: CORBA, DCOM and Java

Sample threats to security

An authorized user accessing information they should not

A user pretending to be someone else to access information

Eavesdropping on others communication Modifying, deleting or maliciously

tampering with information

Page 61: CORBA, DCOM and Java

Features of the Security Service

Identification and authentication Authorization and access control Auditing Communications security Non-repudiation Administration of security policy

Page 62: CORBA, DCOM and Java

Security Conformance Levels

Security Level 1 - targeted at securing security-unaware applications. Allows for client authentication, secure communications and method-level access control based on security policies.

Security Level 2 - supports all of the above and supports integrity, trust and auditing. Targets security-aware application which may enforce their own policies.

Page 63: CORBA, DCOM and Java

CORBA World Players

Netscape (bundle CORBA-clients with their web browser)

Oracle has adopted CORBA/Java as their base platform

JavaSoft - is layering RMI on top of CORBA IIOP. Sun has also adopted Visibroker as its ORB technology.

IBM/Lotus: Adopted base infrastructure is CORBA/Java.

Page 64: CORBA, DCOM and Java

CORBA World Players - Others

Iona

Visigenic/Inprise

HP

Tandem

Novell

I-Kinetics

Expersoft

BEA

Symantec

ParcPlace

Penumra

Inprise

Sybase

NetDynamics

Vignette

Allaire

and 800 more!

Page 65: CORBA, DCOM and Java

Distributed Component Object Model

(DCOM)*

Microsoft Version of Distributed Object Computing

* Material for this tutorial is based on Orafali and Harkey book onClient Server Programming with Java and CORBA and Richard Grimesbook on DCOM Programming.

Page 66: CORBA, DCOM and Java

DCOM and CORBA

Like CORBA, DCOM adheres to separation of interface from implementation using Microsoft Interface Definition Language (IDL) based on DCE. Not compatible with CORBA IDL.

Also provides an additional IDL for OLE automation called Object Definition Language (ODL).

Page 67: CORBA, DCOM and Java

DCOM

Unlike CORBA, DCOM does not support multiple inheritance. It supports multiple interfaces and compositional architectures.

Like CORBA, DCOM provides both static and dynamic bindings for methods

Type Library in DCOM corresponds to Interface Repository in CORBA.

DCOM registry corresponds to Implementation Repository.

Page 68: CORBA, DCOM and Java

DCOM Interface

DCOM Interface is collection of method calls.

DCOM interface is language neutral Microsoft provides language bindings for

Visual C++, Visual Basic, and Visual J++.

Inprise ’s Delphi products provide bindings for Pascal.

Page 69: CORBA, DCOM and Java

ObjectUser

Pointer

InternalData

InterfaceFunction

Table

Implementationof MemberFunctions

Pointersto

Functions

DCOM Object

DCOM Interface

To access DCOM interface, clients use pointer to an array of function pointers - called virtual table or vtable.

Page 70: CORBA, DCOM and Java

DCOM Conventions

Plug-in-jack pictorial representation of components.

Interface by convention is named with a letter beginning with capital “I” - e.g. IDispatch

At run time, interfaces are known by their Interface Identifier (IID)

IID is globally unique (GIID) - 128-bit IDs.

Page 71: CORBA, DCOM and Java

DCOM Object

Also known as ActiveX object.

DCOM object implements all the interfaces the object supports.

Identified by a unique 128-bit Class ID (CLSID)

Implements IUnknown interface

Interface A

Interface B

Interface C

DCOMObject

IUnknown

Page 72: CORBA, DCOM and Java

DCOM Server

DCOM servers is a DLL or EXE or a Java Class.

Server must provide a class factory for instantiating new objects

IClassFactory2 interface needs to be supported if object is instantiated only if a valid license file is present DCOM Server

ClassFactory

DCOMObject

IClassFactoryor

IClassFactory2

ObjectInterfaces

IUnknown

Page 73: CORBA, DCOM and Java

DCOM Local/Remote Transparency

In-process servers: server DLLs that can be loaded in the same process as the client.

Local servers: clients use DCOM’s Lightweight RPC (LRPC) to communicate with server running on a different process space in the same machine.

Remote servers: clients use DCE RPC-like mechanisms to make method invocation.

Page 74: CORBA, DCOM and Java

DCOM IUnknown Interface

IUnknown Interface consists of: QueryInterface - for supporting interface

negotiations AddRef - to support garbage collection Release - to support life cycle

management

Page 75: CORBA, DCOM and Java

Writing a Java Client/Server Application in

DCOM

1. Create DCOMIDL

2. GenerateGUIDs

3. MIDL

4. JavaTLBInterface

Interface Summary.txt

5. ImplementServer

6. jvc

7. JavaReg

ClassProxy

8. ImplementClient

9. jvc

10. JavaReg

11. jviewClient Server

Page 76: CORBA, DCOM and Java

DCOM Conclusions

DCOM is maturing rapidlyJava support is there, although it is for Microsoft version of JavaBiggest differences with CORBA

Support limited to Wintel platforms Range of services available limited (CORBA has

from Workflow to security to vertical domain standardization efforts

Biggest drivers Freely available with Windows NT MTS and MSMQ and other internet Microsoft

technologies

Page 77: CORBA, DCOM and Java

Java Technology

Page 78: CORBA, DCOM and Java

Why Java

Java is a simple, efficient, secure, portable high-

performance programming language.

It is similar to C++, easy to learn.

It has no pointer arithmetic, no need to free memory

which is a serious problem in C/C++.

Very compact Runtime.

Page 79: CORBA, DCOM and Java

ENTERPRISE JAVABEANS COMPONENTS

Server Platform

J

T

S

J

M

A

P

I

J

N

D

I

J

I

D

L

J

M

S

J

D

B

C

Servlets

HTMLJavaBeans

IIOP RMI and other Protocols

Some Java Modules

Page 80: CORBA, DCOM and Java

Other Java APIs

Java Telephony API

Java Wallet

Java Server API

Java Security API

Page 81: CORBA, DCOM and Java

JDBC

Page 82: CORBA, DCOM and Java

JDBC (Database Connectivity)

JDBC is a “call level “ SQL interface from Java. This facilitates the execution of SQL statements and return the results.

JDBC is an interface level specification. JDBC API is implemented on top of

existing SQL level API -- ODBC.

Page 83: CORBA, DCOM and Java

JDBC (Contd)

The most important JDBC interfaces are java.sql.Environment provides support for

creating new database connections java.sql.Connection to connect to a

particular database java.sql.Statement for executing a SQL

statement on a given Connection java.sql.ResultSet to access the resultset

for a given SQL statement.

Page 84: CORBA, DCOM and Java

JDBC (Contd.)

Furthermore java.sql.Statement has two

additional interfaces java.sql.PreparedStatement for executing

a pre-compiled SQL statement java.sql.CallableStatement for executing

a database stored procedure

Page 85: CORBA, DCOM and Java

JDBC (Contd)

A JDBC-ODBC Bridge driver currently sits between the ODBC Drivers (provided by database vendors) and the JDBC API.

Page 86: CORBA, DCOM and Java

JavaBeans

Page 87: CORBA, DCOM and Java

JavaBeans

JavaBeans is a software Component model for Java.

Facilitate third party ISVs to create and Ship Java Components that can be composed together by end -users (VB model)

Page 88: CORBA, DCOM and Java

JavaBean Component Model

JavaBean ComponentMethods

Properties

Customizer

Events

JAR

BeanInfo

* From Orafali’s book

Page 89: CORBA, DCOM and Java

CORBA Component Model*

CORBA ComponentMethods

Properties

Customizer

Events

CAR

Component Info/IDL

* From Orafali’s book based on the main submission team

Page 90: CORBA, DCOM and Java

JavaBeans

JavaBeans provides a platform independent component architecture.

Will bridge to ActiveX, OpenDoc and LiveConnect.

Page 91: CORBA, DCOM and Java

Distributed Beans

DatabaseServer

CORBA SERVER

JAVARMI

IIOP

JDBC

Page 92: CORBA, DCOM and Java

JAR

Java Beans are packaged as JAR (Java Archive). (Beans

come in a JAR :-)

Page 93: CORBA, DCOM and Java

Pragmatics

How does one create a Bean??

Page 94: CORBA, DCOM and Java

Creating Beans

Write the component in Java using the JDK 1.1 Event

model (Event Delegation model) and implement the

appropriate Listeners and add the listeners to the

sources.

Creating a BeanInfo class is highly recommended.

Use Design Patterns for Creating the Java Beans

Page 95: CORBA, DCOM and Java

Design Patterns

In very simplistic terms, design patterns are naming

conventions.

For example, if there is a property named Label, you

would have public String getLabel() { } public void setLabel(String labelname) { }

Page 96: CORBA, DCOM and Java

Design Patterns

Boolean Properties public boolean isRed() { } public void setRed( Color red) { }

Page 97: CORBA, DCOM and Java

Design Patterns

EventListeners public void add<ListenerType> (<ListenerType>

listener) public void remove<ListenerType> (<ListenerType>

listener)

Page 98: CORBA, DCOM and Java

Example

addSriniEventListener(SriniEventListener srevt)

removeSriniEventListener(SriniEventListener srevt)

Page 99: CORBA, DCOM and Java

Bean Analysis

Java beans

Introspection

Reflection

DesignPatterns

BeanBoxes

Page 100: CORBA, DCOM and Java

Introspection

Discovers Events, Properties and Methods when the Bean

Designer provides a BeanInfo Class

Page 101: CORBA, DCOM and Java

Reflection

Reads Events, Properties and Methods using Design

Patterns

Page 102: CORBA, DCOM and Java

JAR Files

is similar to Zip Archives and may optionally have a

MANIFEST file with information describing the contents of

the JAR file.

JAR files are used to collect class files, serialized objects,

images help files and similar resource files.

Page 103: CORBA, DCOM and Java

MANIFEST FILES

A JAR file that wants to advertise its contents should have

a MANIFESTS file. The MANIFEST file will indicate which of

the potential beans in the JAR archive are actual beans. If

there is no MANIFEST every potential class is regarded as

a bean.

Page 104: CORBA, DCOM and Java

Authentication

JAR files can be signed to provide authentication.

Page 105: CORBA, DCOM and Java

Lotus InfoBus

Page 106: CORBA, DCOM and Java

Producer Infobus Consumers

Page 107: CORBA, DCOM and Java

Change Notification

Producers and Consumers notify changes performed by

each other to the shared data.

An Event based mechanism.

Supports security and access control

Page 108: CORBA, DCOM and Java

More Information

Can be found including specs and such at http://java.sun.com/beans/infobus

Page 109: CORBA, DCOM and Java

Java Blend

Page 110: CORBA, DCOM and Java

What is Java Blend

Java Blend Integrates Objects in the Java Programming

language with Enterprise Objects.

Provides a single consistent, coherent object model for

enterprise based on the Java object.

Page 111: CORBA, DCOM and Java

Java Blend

Jointly developed by JavaSoft and Baan.

Currently the programmer must explicitly convert to and

from Java objects and database objects.

Current applications are split into Java part and SQL part

and both interacting through JDBC or some similar

mechanism.

Page 112: CORBA, DCOM and Java

Object-Relational Mapping

Currently done by the programmer.

Decomposition of Objects into many tables or build

objects from many tables.

Mappings between foreign keys and Object references

Mappings between field types and SQL types

Page 113: CORBA, DCOM and Java

Object Relational Mapping

Map and or Infer Inheritance Relationships from Foreign

keys

Perform Transactions and process the results of

transactions.

Page 114: CORBA, DCOM and Java

Java Blend

Java Blend provides automatic mapping between Java

Objects and backend relational database tables.

The programmer only deals with Java Objects and is

unaware of the SQL.

SQL translations, Database representations (relational)

are transparent to the programmer.

Page 115: CORBA, DCOM and Java

Advantages

Easy access to enterprise relational data from Java

Programming Language.

No need to know, SQL, DDL and other relational database

specific ideas.

Significant reduction in application development time.

Page 116: CORBA, DCOM and Java

Java Blend Environment

development environment supports automatic object<--

> Relational Mapping.

Runtime environment supports Transaction Management Caching Query Processing

Page 117: CORBA, DCOM and Java

Development Process

A mapping tool is used to map business objects written in

Java to database schema.

Queries can be written in OQL (ODMG compliant)

Page 118: CORBA, DCOM and Java

JVM

JDBC

Java Blend Runtime

Persistent Objects

Enterprise Application

Page 119: CORBA, DCOM and Java

Transaction

Manager

Run Time

CacheQuery

Engine

Java Blend Runtime Architecture

Page 120: CORBA, DCOM and Java

Other Advantages

Multiple threads for multiple user transactions

Multiple simultaneous transactions per application

Upon commit stores objects in the database

Rollback mechanisms

Page 121: CORBA, DCOM and Java

Performance

Increases performance by optimistic concurrency

control(i.e., does not hold read and write locks on server)

Runtime caching

Support for stored procedures

Page 122: CORBA, DCOM and Java

EJB and Java Blend

Java Blend works with EJB APIs

Extremely scalable.

Page 123: CORBA, DCOM and Java

Enterprise Java Beans

Page 124: CORBA, DCOM and Java

What is EJB

It is a distributed Software Component Architecture.

It is a Framework for Creating Middleware.

EJB is part of the Enterprise Java API

Page 125: CORBA, DCOM and Java

EJB

It is a Server side Component model

It focuses on Business Logic.

Page 126: CORBA, DCOM and Java

Enterprise Java Bean Architecture*

*From EJB specification document

Page 127: CORBA, DCOM and Java

Enterprise Java Bean Containers*

OTS/JTS

ContainerMetadata

Factories

ORB

Activation/Deactivation

StateManagement

Security

EJB1EJB2

EJB3

* Orafali’s Book

Page 128: CORBA, DCOM and Java

EJB Architecture

EJB architecture consists of EJB Servers EJB Containers EJB Clients EJB Auxiliary Systems such as JNDI, JTS and others.

Page 129: CORBA, DCOM and Java

The Various Players

EJB Providers Provide Enterprise Java Beans (Components)

EJB Server Providers Creates and sells EJB servers

EJB Container Providers sell EJB containers Usually the server provider will also provide containers

Page 130: CORBA, DCOM and Java

The Various Players

EJB Application Assemblers Will enable application building using EJB

components, servers and Containers.

Page 131: CORBA, DCOM and Java

EJB Servers

EJB Servers are similar to CORBA ORBs

It Provides Naming(JNDI) and Transaction Services (JTS)

Makes containers visible to clients

Page 132: CORBA, DCOM and Java

EJB Containers

Encapsulate the Bean

Client accesses Beans’ methods through the container

methods

Container methods map to Bean methods

Client only knows about container methods.

Page 133: CORBA, DCOM and Java

EJB Clients

First discover the services (ala CORBA ) using

mechanisms such as JNI

Request Bean Services through Container Services.

Page 134: CORBA, DCOM and Java

Types of Enterprise Java Beans

Usually categorized as Session Beans or Entity

Beans

Page 135: CORBA, DCOM and Java

Session EJB

Is associated with a Single Client.

It is created and destroyed by a client

Page 136: CORBA, DCOM and Java

Entity EJB

Are Shared by multiple clients

Persistence is supported.

Page 137: CORBA, DCOM and Java

Structure of an EJB Client

First Locate a EJB container using a directory service

Allocate a bean

Use the bean services

Dispose the bean.

Page 138: CORBA, DCOM and Java

EJB Support

IBM

Oracle

Lotus

Novell

Iona

Netscape

Inprise

and many many others

Page 139: CORBA, DCOM and Java

More on EJB

can be found at

www.java.sun.com/products/ejb/index.html

Page 140: CORBA, DCOM and Java

Some concluding thoughts....

Page 141: CORBA, DCOM and Java

ActiveXClients A

ctiv

e X

ProxyOrbixOrb

Proxy

Java Beans

VisiOrb

COMSrvc

ActiveX

JavaCode

OrbixSrvc

VisiSrvc

Java Beans

DCOM Bri

dge

CORBA

Act

iveX

B

r idg

e

DC

OM

/ C

OR

BA Bridge CORBA

ActiveX

CORBA/DCOM/JAVA Interoperability

Acknowledgement: Adapted from a view foil by Tad Davis, CareFlow|Net

Page 142: CORBA, DCOM and Java

Bottom Line for Distributed Object Computing

You can develop using CORBA

You can develop using DCOM

You can certainly use Java

They all in reality can inter-operate in fairly straight

forward fashion.