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.

ServiceLocator Class<br />

ServiceLocator Class<br />

<strong>Ocean</strong> provides services to satisfy commonly requested functionality. A service is an object<br />

that provides custom support to other objects, e.g. UnitService or<br />

CoordinateSystemService, and may also be made available in third party modules.<br />

Services may be of two types. First are those that are handled by System interfaces in the<br />

.NET framework. Second are services that are identified by the type of service and the<br />

type of object that needs the service.<br />

Services provided by the product family, such as the unit or coordinate system services,<br />

are made available at startup. You may create services to work with objects created by<br />

your modules. In such cases, your services should be added in your modules<br />

Initialize method. You may acquire services for use after modules have been<br />

initialized, typically in the Integrate method.<br />

The CoreSystem.Services property is a ServiceLocator class that manages services.<br />

ServiceLocator supports a mechanism for registering and looking up service objects<br />

(Fig. 3-12 on page 3-71). Its purpose is to locate service instances for services requested<br />

by your modules. It supports three use cases including lookup by a service type, lookup for<br />

an object, and lookup for a given data type. ServiceLocator will inspect the<br />

inheritance hierarchy to find the best matching service when looking up services for type<br />

and object instances.<br />

CoreSystem<br />

ServiceLocator<br />

Fig. 3-12 Core System Access to ServiceLocator<br />

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

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

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

Saved successfully!

Ooh no, something went wrong!