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.

Using the convenience class is the easiest way to do this since it implements<br />

IDescribedArgumentsSource.<br />

Custom Worksteps<br />

public abstract class DescribedArgumentsByReflection :<br />

IDescribedArgumentsSource<br />

{<br />

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

protected DescribedArgumentsByReflection();<br />

}<br />

Each public property in your derived argument package class becomes a<br />

DescribedArgument object. All of the DescribedArguments objects are packaged<br />

into an array, and the array is returned whenever needed.<br />

<strong>Ocean</strong> uses the DescribedArguments array from your argument package to retrieve all<br />

of the argument information used in the convenience functionality such as building the<br />

default UI’s.<br />

Advanced - Argument Package Alternatives<br />

The alternatives are an advanced topic; a typical developer would just use the<br />

convenience class.<br />

Now that we have covered the details of how argument packages work internally, we can<br />

discuss the two alternatives:<br />

• Implementing IDescribedArgumentsSource yourself. This is more work, but you<br />

still get to use all the <strong>Ocean</strong> convenience functionality.<br />

• Writing an argument package class that neither implements<br />

IDescribedArgumentsSource nor derives from<br />

DescribedArgumentsByReflection. This means you will not get the <strong>Ocean</strong><br />

convenience functionality.<br />

Advanced - Implementing IDescribedArguments-Source<br />

You should implement IDescribedArgumentsSource yourself when you want to<br />

reuse an existing class that already encapsulates the arguments. Implementing the<br />

interface lets you avoid rewriting your code to force it into<br />

DescribedArgumentsByReflection.<br />

This technique still gives you all of the benefits of the <strong>Ocean</strong> convenience functionality:<br />

default UI’s and Workflow editor interoperability.<br />

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

Workflow 6-297

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

Saved successfully!

Ooh no, something went wrong!