Adam Lally wrote:
On 1/11/07, Michael Baessler <[EMAIL PROTECTED]> wrote:
Thilo Goetz wrote:
> CAS.declareFsVariable(String name, Type type)
> CAS.isFsVariable(String name):boolean
> CAS.getFsVariableType(String name):Type
I would like to have an additional method like

CAS.getFsVariableForType(Type type):FS

so that an analysis component do not have to know the variable name, it
only have to know that for a certain type a variable exist that contains the
FS of interest and can retrieve it.


I think Michael is onto the same point that concerns me.  To use this
feature, components have to agree on what variable names they are
going to use.  So we're creating another kind of dependency that I
believe should be documented in the capabilities.  Sure, people could
build this themselves already, but if we make it built-in then we're
strongly encouraging its use and should consider all the implications.
If we had more expressive capability spec (so you could say I
create/require an instance of type FsVariable with name="Foo") then
that might be a way to go.

I guess we could do that in addition. How would you imagine this would work?

I'm mainly addressing a practical problem here, and want to give people a viable alternative to modifying the DocumentAnnotation. I think this approach is fairly forward-compatible as well, in the sense that it can later be strengthened with descriptor-based integrity constraints.


I don't think getFsVariableForType(Type) would completely address the
issue.  There can be more than one variable for the same type, so the
downstream component would still not have any idea which one it wanted
to use.

True, but it's better than anything we have today. At least this way two components *can* communicate, if they want to. If you want additional safety, you pass the variable name around as a parameter. That's the best way to ensure that everybody is using the same one.

--Thilo

Reply via email to