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.

The <strong>Ocean</strong> Module<br />

between different modules and allows modules to use services and features of other<br />

modules. The order of execution between modules is undefined, with the exception that<br />

the ModuleDependency attribute enforces ordering when required.<br />

Initialize<br />

Integrate<br />

IntegratePresentation<br />

Disintegrate<br />

Dispose<br />

Initialize<br />

Integrate<br />

IntegratePresentation<br />

Disintegrate<br />

Dispose<br />

Initialize<br />

Integrate<br />

IntegratePresentation<br />

Disintegrate<br />

Dispose<br />

all finished<br />

before next<br />

stage<br />

Fig. 3-3 Module Lifecycle Phase Execution<br />

Default Constructor<br />

During the product startup the <strong>Ocean</strong> Core will load modules as defined in the<br />

configuration file for the product family. Modules may also be loaded dynamically as<br />

discussed in “Dynamic Module Loading” on page 3-34. The <strong>Ocean</strong> Core will call the default<br />

constructor to instantiate each module. All modules must have a default constructor as<br />

defined by the interface. The constructor should:<br />

• Acquire the module’s license<br />

• Initialize any private fields for the module<br />

• Acquire any resources the module needs.<br />

The module license is acquired from the license provider defined for the module class by<br />

the LicenseProvider attribute. The license provider may be whatever licensing<br />

mechanism you choose as long as it properly derives from the<br />

System.ComponentModel.LicenseProvider class.<br />

The code sample below shows the FooBar licensing provider defined for the<br />

LicenseProvider attribute. The actual license is acquired by the<br />

LicenseManager.Validate method, which is given the type of our module class. If a<br />

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

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

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

Saved successfully!

Ooh no, something went wrong!