02.05.2014 Views

CoreandServices.book - Ocean - Schlumberger

CoreandServices.book - Ocean - Schlumberger

CoreandServices.book - Ocean - Schlumberger

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

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

including a name for GUI presentation, an assembly qualified type name, and the module<br />

type.<br />

using Slb.<strong>Ocean</strong>.Core;<br />

...<br />

// Find a module<br />

IModule m = CoreSystem.Modules.GetModule(typeof(Hello<strong>Ocean</strong>Module));<br />

// Find included modules<br />

ReadOnlyModuleReferenceCollection col = CoreSystem.Modules.Includes;<br />

foreach (ModuleReference mod in col)<br />

{<br />

CoreLogger.Info (mod.ToString());<br />

CoreLogger.Info ("Assembly: " + mod.AssemblyQualifiedTypeName);<br />

CoreLogger.Info ("Type: " + mod.ModuleType.ToString());<br />

CoreLogger.Info ("Name: " + mod.SimpleName);<br />

}<br />

...<br />

Module Interface<br />

Modules are created by the implementation of the IModule interface. IModule is<br />

defined in the Slb.<strong>Ocean</strong>.Core namespace. Modules must also implement<br />

IDisposable defined by the Microsoft System.ComponentModel namespace to<br />

release any allocated unmanaged resources.<br />

The IModule interface defines five methods of the module lifecycle phases and inherits<br />

from IDisposable. The phases and their methods are:<br />

• Construction (default constructor)<br />

• Initialization (Initialize)<br />

• Integration (Integrate)<br />

• Presentation integration (IntegratePresentation)<br />

• Disintegration (Disintegrate)<br />

• Disposal (Dispose)<br />

The order of execution of the module lifecycle phases by the <strong>Ocean</strong> Core is important and<br />

is shown in the list above. Also important is the execution of the phases when multiple<br />

modules are present. The first phase of all modules is completed before the next phase of<br />

any module is started. This execution order is important in eliminating dependencies<br />

3-24 <strong>Ocean</strong> Application Development Framework 2008.1<br />

<strong>Schlumberger</strong> Private

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

Saved successfully!

Ooh no, something went wrong!