Sie sind auf Seite 1von 27

DCOM PERSISTENCE SERVICE

ABISHA.N, DIVYA.R

DCOM Services:
Major Services offered by DCOM are, 1. 2. 3. 4. 5. Persistence Service Queuing Service Transaction Service Security Service Clustering Service

PERSISTENCE
Storing an Objects state permanently. Persistence is the ability of an object state to survive termination of the process in which the object executes. Persistence is transparent to client Persistent state service hide the details of data stores from server objects

AIMS OF PERSISTENT SYSTEM


1.

Illustration of perpetuity which gives an illusion that the software system is continuously active. >>This is done by storing the state of the private member variables of an objects and then retrieving their values when needed. Allow a system to work with a large collection of data than that could be held by the system memory. Share data between multiple processes.

1.

2.

ACHIEVEING PERSISTENCE
To achieve persistence, an object should perform the following:

Implement the IPersistFile interface. Read its data at the start of each method. Write data to Storage whenever the state of the object changes. It is done without the acknowledgement of the client.

REQUIREMENTS FOR PERSISTENT SERVICES


1)

2)
3)

Object-oriented databases File Systems Structured storage

FILE SYSTEMS: In file systems, each bit has a unique address. Files that store data are identified by their pathname.

Structured storage

Structured hierarchy with the root file having the substorages.

2 methods:
load store

Smart pointers: >> Includes Object ID along with the address.

Structured Storage(CONT)
Steps in storing objects to Structured storage: 1. Construct object(Objects Persistent object registry) added to

2. load and store cycle(Object utilize smart pointers to restore pointer values)

ELEMENTS OF STRUCTURED STORAGE

STREAM

TYPES OF STORAGE
STREAM : DISK STRUCTURE.

STORAGE

STORAGE : DIRECTORY STRUCTURE.

STREAM OBJECT

Provides ISTREAM interface. Equivalent to single disk file. Can have internal structure.

STORAGE OBJECT

Provides ISTORAGE interface. Equivalent to directory structure. Can have any number of sub-storages and stream.

MODES OF ACCESS

DIRECT MODE

TRANSACTE D MODE

Changes made are immediate and permanent

Changes are buffered so that they may be saved/committed when modifications are complete

MONIKERS

The file names is used to identify an object. However, file names are unintelligent. Intelligent can be brought about by encapsulating the information of working with the names within the name itself. Here, the name becomes an object that implements name- related interfaces. These objects are called monikers. Each individual moniker object maintains its own name data that identifies some other particular object or operation.

IMONIKER

A moniker is simply an object that supports IMONIKER interface. IMONIKER interface includes IPersistStream interface.

PERSISTENT FORM OF MONIKERS:

Can be saved to and loaded from streams. Also helps to provide transparency to clients.

OPERATIONS OF IMONKER
1. BINDING:
Binding
Binding

to the object that it points.

function in IMONKER takes as a parameter the interface identifier by which the client communicates with object. to locate the object. Binding: Avoids repeated Connections.

Used

Expensive

OPERATIONS OF IMONKER(cont)
2. REDUCTION:
Re-writes

itself into another equivalent MONIKER.

3. DISPLAY NAME:
Equivalent

to file name of an object.

RUNNING OBJECT TABLE:


Instantiated COM object register themselves and their MONIKER in the table, called Running object table.

INTERFACES

COM allows read and write itself to storage by providing additional interfaces. 3 important interfaces are:

IPersistStorage IPersistStream IPersistFile

Monikers in Detail

Object or Component that refers to specific instance of another object. Name which uniquely identifies an COM object Persistent Object & Naming Object 1:1 IMoniker Interface is a Framework Co Create Instance cant be used

Implementations of Monikers

File Monikers: Wrapper for file path name Item Monikers: Object within another Object Pointer Monikers: Object Exist only in Running State Anti-Moniker: Inverse of A moniker Composite Monikers: Composed of Other Monikers Class Monikers: Wraps CLSID URL Monikers: Manages URL Custom Moniker: Object Implements IMoniker Interface

IMoniker Interface Functionalities


BindToObject BindToStorage GetDisplayName ParseDisplayName IsSystemMoniker Reduce RelativePathTo

CompositeWith Enum IsEqual Hash IsRunning Inverse CommonPrefixTo

Inheritance Hierarchy

IUnknown

IPersist
IPersistStream

IMoniker

IPersist

Main Interface Base for Persistent Framework

Some Specific Interfaces: IPersistFile IPersistStorage IPersistSttream IPersistStreamInit

IPersistFile
Reads/Writes information into a Completely Separate File outside structured storage. Methods: 1.Load 2.Save 3.IsDirty 4.SaveCompleted 5.GetCurFile

IPersistentStorage
Reads/Writes information in a storage hierarchy 1.Load 2.Save 3.IsDirty 4.SaveCompleted 5.InitNew 6.HandsOffStorage

IPersistStream
Reads/Write Information in a single stream Basic Model and provides semantics of simple load and save 1.Load 2.Save 3.IsDirty 4.GetSizeMax

IPersistStreamInit

Improves the functionality of IPersistStream Initialization function is added

Real Time Examples

a moniker is created for a query, the programmer can reuse the query simply by calling the moniker in the code. Transactions made in Ecommerce

Das könnte Ihnen auch gefallen