Configuring the Template Attribute Resolver to consult its dependencies.
Rod Widdowson
rdw at steadingsoftware.com
Sat Nov 17 06:09:10 EST 2018
I'm moving this out from JIRA since it will be easier to discuss in here..
Last night Scott noticed that with the new (3.4) dependency syntax being explicit about the input attributes the <SourceAttribute>
becomes spurious - all the source attributes are mentioned by name or by wild card, so you don't need to mention them in the
Template description. Its duplicate information, right?
We initially thought that the work had been done and that the SourceAttributes were not needed (as well as being spurious), but
that's not be the case. Furthermore it cannot be made that way in V3. The issue is that as far as the code (at the api level) is
concerned the Dependencies are returned as a Set, whereas for obvious reasons the template requires a List.
It turns out that this assumption that dependencies are a Set is reasonably widespread. So, for instance, the parsers parse all the
<Dependency> elements, and then all the <InputAttributeDefinition> elements and finally all the <InputDataConnector> elements.
So, whilst it is possible to remove the SourceAttributes from the Template Attribute Definition, it is not trivial and can only be
done in V4.
That then begs the question, do we want to?
Actually there are two questions:
1) Do we want to make the input dependency list ordered? Are there any other use cases?
I have no opinion on this. Anybody else?
2) If we do, is it worth going the extra step and removing the <SourceAttribute> from the template.
Perhaps because of the amount of work involved, I'm not convinced by the need for this.
On one hand having all the information in one place is a great simplification (if data is in two places then eventually one will be
wrong), on the other hand the configuration can be a bit tricksy: Consider a case where the input attributes are sourced from two
data connectors but the need for the attributes is interleaved. You would end up with a list of
<InputDataConnector ref="first" attributeNames="one"/>
<InputDataConnector ref="second" attributeNames="two"/>
<InputDataConnector ref="first" attributeNames="three"/>
<InputDataConnector ref="second" attributeNames="four"/>
And this in itself needs to be made to work - it probably already does, modulo of course the whole Set vs List thing.
Anbody got any thoughts?
/Rod
More information about the dev
mailing list