[ 
https://issues.apache.org/jira/browse/UIMA-2874?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13654712#comment-13654712
 ] 

Richard Eckart de Castilho commented on UIMA-2874:
--------------------------------------------------

Yep, that sums it up.

As for enums, I tend to avoid them unless I'm pretty sure that I know the full 
set of values and unless I'm pretty sure that the values do not change. If we 
consider these Serialisers to be software components implementing, then I 
wouldn't create an enum for them. A user of the framework may implement his own 
serializer and that would not be known to the enum. Effectively, we'd either 
lock out the user extension from all places where the enum is used, or 
otherwise, we couldn't really use the enum anywhere. If you want to convenience 
of a central place of contact for the well-known serializers is what you want, 
a factory class may be an approach. But this would really just be convenience, 
sugar on top of the otherwise extensible framework - even though it may just 
look like an excuse/backdoor to re-introduce static methods, which could serve 
as substitutes for the constructors-with-args.

If serializers would be something that the framework needs to discover, e.g. to 
fill a "file types" select box in some export dialog of the CAS Editor, some 
measure for the discovery of these components would be required. I think, 
however, this is beyond the scope of uimaj-core. It'd rather be something that 
hooks up with the uima-ep-runtime or whatever framework uimaj integrates into. 
If some discovery/registry should be integrated into uimaj-core, it may be 
useful to investigate the Java ServiceLoader API [1] (no experience here yet).

[1] http://docs.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html
                
> binary compression APIs in CAS
> ------------------------------
>
>                 Key: UIMA-2874
>                 URL: https://issues.apache.org/jira/browse/UIMA-2874
>             Project: UIMA
>          Issue Type: Improvement
>          Components: Core Java Framework
>            Reporter: Marshall Schor
>            Assignee: Marshall Schor
>            Priority: Minor
>             Fix For: 2.4.1SDK
>
>
> Rationalize the CASImpl binary compression APIs; add to the CAS Apis.  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to