Inconsistent API for engine and resource creation?

4 views
Skip to first unread message

José Tomás Atria

unread,
Oct 1, 2015, 5:47:29 PM10/1/15
to uimafi...@googlegroups.com
Hello,

i just noticed that the method for creation of analysis engines and external resources is different.

For AE's, this works:

AnalysisEngineFactory.createEngineDescription(
   SomeEngine.class,SomeEngine.PARAM_BOOLEAN, true 
)

But for external resources, the same syntax fails with a ClassCastException

ExternalResourceFactory.createExternalResourceDescription(
    SomeResource.class, SomeResource.PARAM_BOOLEAN, true
)

Looking at the code, I see that ExternalResourceFactory.createExternalResourceDescription(String,Class<? extends Resource>,Object...), which is called by the method above, actually casts parameter values to String on line 177.

Why is this so? Wouldn't it be preferable to have a consistent interface for all component types?

Thanks!
jta

--
entia non sunt multiplicanda praeter necessitatem

Richard Eckart de Castilho

unread,
Oct 2, 2015, 2:20:07 AM10/2/15
to uimafi...@googlegroups.com
Hi,

this list is no longer being used. Please re-post to the uima users mailing list.

http://uima.apache.org/mail-lists.html

Best,

-- Richard
> --
> You received this message because you are subscribed to the Google Groups "uimafit-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to uimafit-user...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages