next up previous contents
Next: dummyok Up: Description Previous: Description   Contents

group setup

The group setup code is defined to be the Perl code within the MICgroup tags, but external to the MICdefine or other MICgroup tags. The expected and recommended use of this code is to set up $obj (discussed below). $obj can then be used as the information source for the field initializations within the MICgroup. It is common to have $obj be iterated (if indeed it is iterated) from some object or variable set defined in the initialization code (within the field space but external to the MICgroup). If $obj is static, then a statement such as:

$obj = $query_object;

is still required.

It is extremely important to realize the ramification for program execution, however. Unfortunately, the relationship of the $obj to the proper instantiation of fields is a bit involved.

The first thing to note is that the existence of $obj controls the halting of field instantiation in a non-dummy fieldspace and the point of dummy production in a dummy fieldspace. That is, if you have a fieldspace that is not a dummy fieldspace, and your code dictates the creation of 5 $obj's, then you will get a maximum of five field groups total. If the fieldspace allowed dummies, the 6th field group and up will be dummies. Note that this means that in the initalization code of the MICdefine, one must not depend on $obj for dummy fieldspaces... it won't be there. See section 4.3.4 for more information on this.

$obj should be independent of the order of indices defined by $index (discussed below). That is, it should either ignore $index or not depend on the order of $index. So, if we have:

$obj = $batch_retriever->get_nth($index);

If we get $index as 2, 20, 1, 5, in that order, the code should react reasonably. So, wanting to look back at the previous $obj or assuming that the previous $index was one less that the current will cause problems.

The fieldspace variable is made available as $fs within the group setup code.


next up previous contents
Next: dummyok Up: Description Previous: Description   Contents