02.05.2014 Views

CoreandServices.book - Ocean - Schlumberger

CoreandServices.book - Ocean - Schlumberger

CoreandServices.book - Ocean - Schlumberger

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Data Management<br />

Data Sources<br />

The DataManager class has a property called DataSourceManager. This property<br />

provides access to the product family implementation of IDataSourceManager.<br />

IDataSourceManager manages the product family data in the form of IDataSource<br />

implementations.<br />

IDataSource Interface<br />

The IDataSource implementation provides properties that identify the object through a<br />

unique string and the class implementing the data source through its<br />

ImplementationName. It also has a property, IsDirty, that indicates that the<br />

underlying data for the object has changed state and needs to be saved. IDataSource<br />

includes methods to open and close the data source and a method to save data to the<br />

data source. Lastly there is a method to set the identity of the IDataSourceManager<br />

for the object. It has an event, IsDirtyChanged, which will be raised when the<br />

IsDirty property changes to true. IDataSource inherits from IDroidResolver,<br />

which can resolve a Droid into an object reference. IDataSource is defined as:<br />

public interface IDataSource : IDroidResolver<br />

{<br />

string Id { get; }<br />

string ImplementationName { get; }<br />

bool IsDirty { get; }<br />

void Open();<br />

void Close();<br />

void Save();<br />

void SetManager(IDataSourceManager dataSourceManager);<br />

}<br />

event EventHandler IsDirtyChanged;<br />

public interface IDroidResolver<br />

{<br />

bool CanResolve (Droid droid);<br />

object Resolve (Droid droid);<br />

}<br />

<strong>Schlumberger</strong> Private<br />

<strong>Ocean</strong> Core 3-55

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!