This is probably the point of largest difference between using Oracle Determinations Engine in Java and using Oracle Determinations Engine in .NET. Both platforms include enumerators (or iterators) in the standard class library and the two different enumerators behave differently. Each of the Oracle Determinations Engine APIs emulates the behavior of the enumerator native to the platform.
Enumerating over all the child entity instances of an entity instance in Java would be done with the following code:
EntityInstanceEnumerator
children = ei.children();
while (children.hasNext())
{
EntityInstance child = children.next();
// Do something to the child
}
The IEnumerator interface in .NET provides a different interface. The language C# also provides a foreach statement to simplify use of lists. The Oracle Determinations Engine API for .NET supports this feature, which allows the above code to be written as:
foreach (IEntityInstance
child in ei.Children)
{
// Do something to the child�
}
This also works for methods that return multiple items but are not strictly collections, such as Session.SelectEntityInstances:
foreach(IEntityInstance
currentInstance in sess.SelectEntityInstances("/p1"))
{
// Do something to currentInstance�
}