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.

Custom Worksteps<br />

In order to build the default UI’s for you, <strong>Ocean</strong> needs to know the details of your<br />

arguments. For each argument, <strong>Ocean</strong> needs to know its role (input/output), its type, its<br />

value, its description, and any special <strong>Ocean</strong> attributes with which it is marked.<br />

All of the argument details are packaged in a DescribedArgument class, which allows<br />

<strong>Ocean</strong> to deal with arguments without having to know their types.<br />

public abstract class DescribedArgument : IDescriptionSource<br />

{<br />

public ArgumentRole ArgRole { get; }<br />

public Type ArgType { get; }<br />

public object Value { get; set; }<br />

public IDescription Description { get; }<br />

public IEnumerable<br />

GetAssociatedAttributes();<br />

protected ArgumentRole ArgRoleCore { get; }<br />

protected Type ArgTypeCore { get; }<br />

protected object ValueCore { get; set; }<br />

protected IDescription DescriptionCore { get; }<br />

}<br />

protected IEnumerable<br />

GetAssociatedAttributesCore();<br />

There would be one of these objects for each argument in an argument package. In our<br />

example, there would be four: two for the inputs and two for the outputs.<br />

All of the described arguments are collected into an array and given to <strong>Ocean</strong> via the<br />

IDescribedArgumentsSource interface.<br />

public interface IDescribedArgumentsSource<br />

{<br />

DescribedArgument[] DescribedArguments { get; }<br />

}<br />

In our example, the array would need to be length four to hold all of the arguments.<br />

Having your argument package implement IDescribedArgumentsSource is the key to<br />

getting the <strong>Ocean</strong> convenience functionality for your argument package.<br />

6-296 <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!