Top Banner
• common and not domain specific • separation of interface and implementation • generic (do not depend on the client object) • how to find services is a different story COS: Common Object Services
78

Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

Mar 31, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

• common and not domain specific

• separation of interface and implementation

• generic (do not depend on the client object)

• how to find services is a different story

COS: Common Object Services

Page 2: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

TECHNOLOGY

CORBA 2 Object Request Broker

Naming

Event

PersistentObject

Life Cycle

Concurrency

Externalization

Relationship

Transaction

Query

Properties

Licensing

Security

Time

Trader Collections

Messaging

CORBAservices

CustomInterfaces

ProprietaryInterfaces

CORBAservicesSpecializations

CORBAfacilitiesSpecializations

ApplicationInterfaces

User InterfaceManagement

InformationManagement

SystemManagement

TaskManagement

CORBAman CORBAtel

CORBAdomains(Domain Interfaces)

CORBAfacilities

Others.......

CORBA-financials

CORBAmedBusinessObjects

DistributedDocument

ComponentsCommon

Management

Adopted Langauge Mappings:C, C++, Smalltalk, Ada95

Interoperability Protocols:Internet (IIOP GIOP) -- DCE ESIOP

CORBAdomainsSpecializations

InternetMobileAgents

ElectronicCommerce

Spec Now

Planned

Key

Page 3: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

Naming Service

Page 4: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

Naming Service

• White pages• Binding: name-to-object association• Naming context: set of bindings with unique names• Resolving: name => object• Contexts can be bound in contexts• Naming Graph: directed graph where nodes are

contexts• Compound name: path in naming graph

Page 5: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

A Naming Graph

user

home

sys

lib

bin l2

l1

c2c1

alden

bill

u1

u2

u3

parent

Page 6: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

struct NameComponent {string id;string kind;

};

typedef sequence <NameComponent> Name;

enum BindingType {nobject, ncontext};

struct Binding {Name binding_name;BindingType binding_type;

};

Some Data Types

Page 7: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

BindingIterator•boolean next_one(out Binding)•boolean next_n(long, out BindingList)•destroy()

Naming Context•bind(Name, Object)•rebind(Name, Object)•bind_context(Name, NamingContext)•rebind_context(Name,NamingContext)•Object resolve(Name)•unbind(Name)•NamingContext new_context()•NamingContext bind_new_context(Name)•destroy()•list(long, out BindingList, out BindingIterator)

Naming Service Interfaces

Page 8: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

Interoperable Naming Service

• Extension of older Naming Service• Resolves interoperability issues (e.g. defines equality

between CosNaming::NameComponents)• Defines an interoperable, stringified form of a

CosNaming::Name• Defines a URL format for names• Allows multiple clients to access a common Initial

Naming Context

Page 9: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

Stringified Names

= a.b/./c/.d

id kind

----------- -----------

a b

<empty> <empty>

c <empty>

<empty> d

Page 10: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

corbaname URL Scheme• It allows URLs to denote entries in a Naming

Service• corbaname syntax

<corbaname> =

“corbaname:” <corbaloc_obj> [“#” <string_name>]

• examples– corbaname://555xyz.com/dev/Ncontext1#a/b/c– corbaname://555xyz.com#a/b/c– corbaname:///#a/b/c– corbaname:///

Page 11: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

Naming Service Interfaces (cont’d)

NamingContextExt

•StringName to_string(Name)•Name to_name(StringName)•URLString to_url(Address, StringName)•Object resolve_str(StringName)

Page 12: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

Obtaining Initial References

• resolving:Object obj = ORB::resolve_initial_references( “NameService” );

• narrowing:NamingContext nc = NamingContextHelper.narrow(obj);

Page 13: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

Configuring Initial Service Refs.

• ORB-specific configuration

• using ORBInitRef– format: -ORBInitRef <ObjectID>=<ObjectURL>– example:-ORBInitRef NameService=IOR:00230021...

• using ORBDefaultInitRef– format: -ORBDefaultInitRef <URL>– example:-ORBDefaultInitRef corbaname://555obj.com/dev

Page 14: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

Starting/Connecting to ORBacus Basic Services

• set CLASSPATH to OBNaming.jar

• starting the service:java com.ooc.CosNaming.Server -i -OAport 10000 > nameserv.ior

• connecting to the service:java MyClient -ORBservice NameService `cat nameserv.ior`

Page 15: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

Trading Object Service

Page 16: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

Trading Object Service

• It is the CORBA Yellow Pages

• Advertises services

• Discovers services

Page 17: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

A Trader and its Users

Trader

Exporter Importer

ExportImport ReplyImport

Request

Service Invocation

Service Reply

Page 18: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

Trading Graph

T T

T T

T

• To distribute the trading object service

• To contextualise the offer space

Page 19: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

Service Description

• A service is described by a service type which includes:– an interface type– zero or more property type(s)

Page 20: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

Property Strength

(default)

mandatory readonly

mandatory, readonly

Increasing Strength

Page 21: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

IDL for properties

Properties are name-value pairs:

typedef Istring PropertyName;

typedef any PropertyValue;

struct Property {

PropertyName name;

PropertyValue value;

};

Page 22: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

Offering a Service

TraderExporter

• service name• object reference• property values

• Offer identifier

Page 23: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

Selecting a Service

Potential Offers

Considered Offers

Matched Offers

Ordered Offers

Returned Offers

servicetype constraints

preferences

searchcardinality

matchcardinality

returncardinality

Page 24: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

Trader Types

• Query

• Simple

• Stand-alone

• Linked

• Proxy

• Full-Service

Page 25: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

Query/Collection Service

Page 26: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

Query Service

• It supports query operations on arbitrary CORBA objects (individually or in a collection)

• Query Languages: OQL, SQL Query

Page 27: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

Query Evaluators

Object

Query Evaluator

Client

Object

Query Evaluator Query Evaluator

Database

Page 28: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

Queryable Collections

Collections may form:• the scope to which a query is applied• the result of a query

Query Evaluator

QueryableCollection

query

QueryableCollection

Collection

query query

query

Page 29: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

Iterator

resetnextmore

Collection

add_elementadd_all_elementsinsert_element_at

replace_element_atremove_element_atretrieve_element_at

create_iterator

CollectionFactory

create

The Collection Interfaces

Page 30: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

Queryable Collection

QueryEvaluator

evaluate

QueryManagercreate

CollectionQuery

prepareexecute

get_statusget_result

The Query Interfaces

Page 31: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

Collection Service

• It supports the creation and manipulation of groups of objects

• Common collections: sequences, queues, stacks, sets, bags, etc.

Page 32: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

Collection Properties

• Ordering of elements

• Access by key

• Element equality

• Uniqueness of entries

Page 33: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

Query vs. Collection Service

• The query service only supports a minimalist collection service

Page 34: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

LifeCycle Service

Page 35: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

LifeCycle Service

• Creating objects

• Deleting objects

• Copying objects

• Moving objects

Page 36: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

Creating an object

HERE THERE

Client

• location of new object

• entity contacted for creation

• finding that entity

• initial values

Page 37: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

Moving/Copying an object

HERE SOMEWHERE THERE

Client Document

• location of copied/migrated object

• entity contacted for copying/migration

• finding that entity

Page 38: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

Creating an object

HERE THERE

Client Factorycreate_object

Page 39: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

Deleting an object

HERE SOMEWHERE

Client Documentremove

Page 40: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

Moving/Copying an object

HERE SOMEWHERE THERE

Client Document

FactoryFinder

move/copy

Page 41: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

LifeCycle Service InterfacesFactoryFinder

Factories find_factories(Key)

GenericFactory

boolean supports(Key)Object create_object(Key, Criteria)

LifeCycleObject

LifeCycleObject copy(FactoryFinder, Criteria)void move(FactoryFinder, Criteria)void remove()

Page 42: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

Moving/Copying an object

HERE SOMEWHERE THERE

Client Document

FactoryFinder

Factory

Page 43: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

Externalization Service

Page 44: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

Externalization Service

• writing and reading an object’s state to/from an external medium (disk, memory, etc.)

• externalised form can:– exist for arbitrary amounts of time– be transported by means outside of the ORB– be internalised in a different ORB

• standard externalisation format

• related to the Relationship and LifeCycle Services

Page 45: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

Externalization Service Interfaces

Stream

IdentifiableObjectStreamableFactory

Streamable

FileStreamFactory

StreamFactory

LifeCycleObject

Relationship

Role

Node

StreamIO

•Key external_form_id•externalize_to_stream(StreamIO)•internalize_from_stream(StreamIO, FactoryFinder)

•externalize(Streamable)•Streamable internalize(FactoryFinder)•begin_context()•end_context() •write_<type>(<type>)

•write_object(Streamable)•write_graph(Node)•<type> read_<type>()•read_object(FactoryFinder, Streamable)•read_graph(Node, FactoryFinder)

create()

create(string)

create_uninitialized()

Page 46: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

Persistent State Service

Page 47: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

POS Components

PDS

POM

PO

Client

PIDPersistentObject

PersistentData Service

Protocol

PersistentIdentifier

Persistent ObjectManager

Datastore

Page 48: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

Persistent Object Service (POS)

• POS is being deprecated by OMG because:– very little use or implementation– generally seen as too complex and imprecisely

specified– poor match to current persistence needs– industry now has a better understanding of what is

needed and the correct level of abstraction

Page 49: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

• PSS will be a replacement for POS– focuses on “a way for CORBA object implementations to

maintain their own persistent state”– simple to use and implement– applicable to existing data storage technologies, but

independent of them– efficient– related to: POA, concurrency, transaction, query, OBV,

security

Persistent State Service (PSS)

Page 50: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

PSS focus

ORB domain

Externalinterface

Servants

Internalinterface

Datastore domain

Page 51: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

Relationship Service

Page 52: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

Object Relationship Graphs

folder

person

book

library

logo

figure

document

containment

referencecheck_out

A role

A relationship

An entity

attribute: due_date

3º2º

0 .. *

1 .. 1

Page 53: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

Key Features• explicit representation of entities and relationships

• arbitrary degree

• type and cardinality constraints

• roles and relationships can be extended with attributes and operations

• high performance

• can relate immutable objects

• traversal without activation

• three levels of service:

– base: simple relationships and roles

– graph: traversal of graphs of related objects

– specific: specialised relationships

Page 54: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

• Flexible multidirectional relationships– object references are unidirectional

• Third party manipulation– relationship and role objects can be exposed to a third

party for manipulation

• Graph traversal

• Relationships and roles can have attributes and operations via IDL inheritance

Advantages over Object Refs

Page 55: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

Property Service

Page 56: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

Property Service

• dynamically associates properties with an object

• properties are name-value pairs

• provides “batch” operations

• clients can access and control property modes and constraints

• implementations can restrict creation, deletion, modification of properties

Page 57: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

Some Data Types

typedef string PropertyName;

struct Property {

PropertyName property_name;

any property_value;

};

enum PropertyModeType {

normal, read_only, fixed_normal, fixed_readonly, undefined

};

Page 58: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

Property Service Interfaces

PropertySetFactory

PropertySetDefFactory

PropertySetDef

PropertiesIterator

PropertySet Property

PropertyDefPropertyMode

creates

creates

defining, deleting,enumerating,existence-checking

PropertyNamesIterator

retrieving constraints,getting and settingproperty modes

Page 59: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

Event Service

Page 60: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

Event Service

• decouples the communication between objects• event: a piece of information that is contributed by an

event source• two event object roles (i.e. suppliers and consumers)• suppliers and consumers support standard IDL interfaces• two communication initiation approaches (i.e. push and

pull)• two communication types (i.e. generic and typed)

Page 61: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

SupplierConsumer

Event Object Roles

• Suppliers– produce event data

• Consumers– process/use event data

Page 62: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

SupplierConsumer

Push

Pull“What’s new?”

“News flash”

Communication Initiation Approaches

• Push model– supplier takes initiative

• Pull model– consumer takes initiative

Page 63: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

SupplierConsumer

Consumer Supplier

Event Channel

Push/Pull

Push/Pull

Event Channel

• an intervening object which accepts events and distributes them to other objects (i.e. it is both a supplier and a consumer)

• it allows multiple suppliers and consumers to communicate asynchronously

Page 64: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

Communication Types

• generic– communication via generic push or pull operations;

event data packaged in a single parameter

• typed– communication via operations defined in IDL; event

data passed by defined parameters

Page 65: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

Transaction Service

Page 66: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

What is a Transaction?

A unit of work that is:

• Atomic

• Consistent

• Isolated

• Durable

Page 67: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

Why do we need a Transaction Service?

It allows transactions to include:

• Multiple, separately defined ACID objects

• Objects and resources from the non-object world

Note: The Transaction Service supports existing IDL Interfaces

Page 68: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

Transaction Models

The transaction service supports:

• Flat transactions

• Nested transactions (optional)

Page 69: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

Transaction Service Basic Elements

Transaction Service

Distributed Client/Server Application

Transactional Client

Recoverable ServerTransactional Server

ResourceTransactional Object

Recoverable Object

transaction context

Page 70: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

Rest of Services

Page 71: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

Concurrency Service

• Mediates simultaneous access to resources– makes actions atomic

• Transactional or non-transactional– if former: uses Transaction Service

• Serializes transactional and non-transactional clients

• Coordination of access to resources through locks

Page 72: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

Concurrency Service (cont’d)

• lock modes:– read, write, upgrade locks– intention locks (variable granularity)

• multiple possession of locks

• two-phase locking

• nested transactions

Page 73: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

Time Service

• obtaining time– UTC representation, 10-7 seconds unit, AD 1582 - 30,000

range– error estimates

• ordering time• time intervals• no support for time zones, dates• two main interfaces:

– TimeService, TimerEventService

Page 74: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

Licensing Service

• mechanism for producers to control the use of their intellectual property

• may be useful in non-profit organizations

• policies implemented in terms of:– time (start/duration and expiration)– value mapping (units, concurrent use, metering)– consumers (assignment, reservation)

Page 75: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

Security Service

• confidentiality

• integrity

• accountability

• availability

Page 76: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

Security Service (cont’d)

• identification, authentication

• authorization, access control

• auditing

• security of communication

• non-repudiation

• administration

Page 77: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

Rounding up

• Common Object Services– fundamental and basic– facilitate using and implementing objects– interfaces, not implementations– rarely available ‘out of the box’– subject to changes

Page 78: Common and not domain specific separation of interface and implementation generic (do not depend on the client object) how to find services is a different.

Information

• CORBA Services documentation:– http://www.omg.org/library/csindx.html

• IDL:– http://www.omg.org/library/idlindx.html