Unintended Consequences of No Primary Output Ports

I find myself always frustrated when I have to use steps that have no
primary output port defined.  I usually have to do some sort of
"fixup" in the pipeline just to make what I believe should be the
minimum.

 I'm often using p:store or ml:insert-document (marklogic) and, while
there is an output, it just isn't defined as primary.  While you can
say that is just a bad step definition, I think it is more than that.
I think it would have been better to say that if your step produces
any output, one of the ports must be defined as primary.

This would also avoid pipeline re-arrangements after edits due to
unconnected output ports.

For example, consider these pipeline snippets:

<p:store/>

and

<p:viewport match="/doc/section">
<p:store href="..."/>
</p:viewport>

These two snippets are not interchangeable in that the first has a
single non-primary output and the second has a single primary output.

My contention is that by requiring when you have output you have one
port designated as primary, a pipeline will be able to be manipulated
with less additional surgery.

In my case recently, it was the fact that I had following step structure:

<p:store .../>

<p:xslt>
   <p:input port="source"><p:pipe step="somewhere" port="result"/>
</p:xslt>

I then wrapped it with a viewport:

<p:viewport>
<p:store .../>
</p:viewport>

<p:xslt>
   <p:input port="source"><p:pipe step="somewhere" port="result"/>
</p:xslt>

and got errors as the primary output port isn't connected.  I had to
do this to fix it:

<p:viewport>
<p:store .../>
</p:viewport>

<p:sink/>

<p:xslt>
   <p:input port="source"><p:pipe step="somewhere" port="result"/>
</p:xslt>


With my proposal, I would have originally been require to write:

<p:store../>

<p:sink/>

<p:xslt>
   <p:input port="source"><p:pipe step="somewhere" port="result"/>
</p:xslt>



-- 
--Alex Milowski
"The excellence of grammar as a guide is proportional to the paucity of the
inflexions, i.e. to the degree of analysis effected by the language
considered."

Bertrand Russell in a footnote of Principles of Mathematics

Received on Thursday, 5 April 2012 20:59:22 UTC