Title: Object-Oriented Standards
1Object-Oriented Standards
2Overview
3Object Management Group (OMG)
- International non profit-making consortium
founded in 1989 to address object standards. - Primary aims of OMG are
- Promotion of object-oriented approach.
- Development of standards in which location,
environment, language, and other characteristics
of objects are transparent. - Not recognized standards group but aims to
develop de facto standards.
4Object Management Architecture
- Object Model (OM) - Design-portable abstract
model for communicating with OMG-compliant
object-oriented systems. - Object Request Broker (ORB) - Handle distribution
of messages between application objects in a
highly interoperable manner. - Object Services - Provide main functions for
realizing basic object functionality.. - Common Facilities - Comprise a set of tasks that
many applications must perform but are
traditionally duplicated within each one.
5(No Transcript)
6Object Model
7Common Object Request Broker Architecture (CORBA)
- Defines architecture of ORB-based environments.
- Some elements of CORBA are
- Interface Definition Language (IDL).
- Type model.
- Interface Repository.
- Methods for getting interfaces/specifications of
objects. - Provides static and dynamic mechanism for clients
to issue request to objects.
8CORBA ORB Architecture
9Object Data Management Group
- Established by vendors of OODBMSs to define
standards. - Have produced an Object Model that specifies a
standard model for the semantics of database
objects. - Design of class libraries and applications using
these semantics should be portable across various
OODBMSs.
10Object Data Management Group
- Major components of ODMG architecture for an
OODBMS are - Object Model (OM)
- Object Definition Language (ODL)
- Object Query Language (OQL)
- C, Smalltalk, and Java Language Binding.
11ODMG OM Basic Modeling Primitives
- Basic modeling primitives are object/literal.
- Objects/literals can be categorized into types.
- All objects of given type exhibit common behavior
and state. A type is itself an object. - Behavior defined by set of operations that can be
performed on or by object. - State defined byvalues objects carry for a set of
properties.
12ODMG Object Model - Objects
- Object types decomposed as atomic, collections,
or structured types. - Objects created using new() of corresponding
factory interface provided by language binding. - Each object has a unique identity, the object
identifier, which does not change and is not
reused when the object is deleted. - May be given one or more names by user.
13ODL Interface for Objects
14ODMG Object Model Built-in Collections
- Contains arbitrary number of unnamed homogeneous
elements each can be instance of atomic type,
another collection, or a literal type. - Only collection objects have identity.
- Use iterator to iterate over collection.
- There are ordered and unordered collections
- ordered collections traversed first to last, or
vice versa - unordered collections have no fixed order of
iteration.
15ODMG Object Model Built-in Collections
- Set unordered collections without duplicates.
- Bag unordered collections that do allow
duplicates. - List ordered collections that allow duplicates.
- Array 1D array of dynamically varying length.
- Dictionary unordered sequence of key-value pairs
with no duplicate keys.
16ODMG Object Model - Relationships
- Only binary relationships supported.
- Traversal paths are defined for each direction of
traversal. - class Branch
- relationship set ltStaffgtHas inverse
StaffWorksAt - class Staff
- relationship Branch WorksAt inverse BranchHas
17Object Definition Language (ODL)
- module DreamHome
- Class Branch
- (extent branchOffices key branchNo)
-
- attribute string branchNo
- .
- relationship Manager ManagedBy inverse
ManagerManages - void takeOnPropertyForRent(in string propertyNo)
- raises(propertyAlreadyForRent)
18Object Query Language (OQL)
- An OQL query is a function that delivers an
object whose type may be inferred from operator
contributing to query expression. - Query definition expressions is of form
- DEFINE Q as e
- Defines query with name Q given query expression
e.
19Example 26.2 OQL Extents Traversal Paths
- (1) Get set of all staff (with identity)
- staff
- (2) Get set of all branch managers (with
identity) - branchOffices.ManagedBy
20Example 26.2 OQL Extents Traversal Paths
- (3) Find all branches in London
- SELECT b.branchNo
- FROM b IN branchOffices
- WHERE b.address.city "London
-
- This returns a literal of type bagltstringgt.
21Example 26.3 OQL Use of DEFINE
- Get set of all staff who work in London (without
identity) - DEFINE Londoners AS
- SELECT s
- FROM s IN salesStaff
- WHERE s.WorksAt.address.city "London
- SELECT s.name.lName FROM s IN Londoners
- This returns a literal of type setltstringgt.
22Example 26.4 OQL Use of structures
- (1) Get structured set (without identity)
containing name, sex, and age for all staff who
live in London - SELECT struct (lNames.name.lName, sexs.sex,
- ages.age)
- FROM s IN Staff
- WHERE s.WorksAt.address.city "London
- This returns a literal of type setltstructgt.
23Example 26.4 OQL Use of structures
- (2) Get structured set (with identity) with name,
sex, and age of all deputy managers over 60 - class Deputy attribute string lName attribute
sexType sex attribute integer age - Typedef bagltDeputygtDeputies
- Deputies (SELECT Deputy (lNames.name.lName,
- sexs.sex, agex.age)
- FROM s IN salesStaff
- WHERE position "Deputy AND s.getAge gt 60)
- This returns an object of type deputies.