Steven Bethard wrote:
> On Wed, May 13, 2009 at 5:29 PM, Cawley, Tim
> <[email protected]> wrote:
>> I find a common problem is that parameter names in a descriptor can be
>> misspelt. While the problem settles down once the code and descriptors
>> are stable, it still got me thinking about two things.
>>
>>        1. Could parameter names in a component descriptor be a
>> reference to a "public static final String" in the implementing class.
> 
> For what it's worth, in ClearTK we've stopped using analysis engine
> and CPE descriptors entirely because of the issues with keeping them
> in sync. Replacing them with code means that we can now just refer to
> our static final variables directly, and the compiler enforces that we
> didn't misspell anything (and fixes references automatically when we
> refactor).

I don't know the details of what you did, but it sounds to me like
you threw many advantages of UIMA (reusability, transparent remotability
etc.) right out of the window.

> 
>>        2. Secondly do we need a way of setting acceptable values for a
>> parameter?  If these acceptable values are accessible both in the
>> descriptor and in the code, then it probably doesn't mater where they
>> are defined (i.e. desc or code). If I had a list or enumeration of
>> acceptable values available then my parameter validation starts getting
>> neater to write or possibly even disappears totally . Obviously this
>> could not be a mandatory thing, but there are situations where I see it
>> being very useful.
>>
>> What do people think?
> 
> Personally, I think trying to fit extra name and type checking to
> descriptors is a lost cause - at some point you'll basically end up
> having to write the Java compiler for XML. ;-)
> 
> Steve

We might want to take a look at what other frameworks are doing
these days.  For example, one could imagine UIMA annotations
(as in Java annotations) in source code, and tooling that
creates descriptors automatically from those.  We should be able
to reconcile the need for external descriptors with the desire
to declare a parameter in just one place.

--Thilo

Reply via email to