You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@uima.apache.org by "Adam Lally (JIRA)" <ui...@incubator.apache.org> on 2006/12/28 17:43:21 UTC

[jira] Commented: (UIMA-10) Split JCas into interface and implementation

    [ http://issues.apache.org/jira/browse/UIMA-10?page=comments#action_12461223 ] 
            
Adam Lally commented on UIMA-10:
--------------------------------

I fixed a few more that you missed -- the example SimpleTextMerger and SimpleTextSegmenter, and the OpenNLP wrapper examples.  The OpenNLP stuff is tricky because it's not in a source directory due to having a dependency on the OpenNLP jars which we don't ship.

The only remaining occurrences of JCasImpl seem to be in JCas-generated classes and from other implementation classes.

I still think that moving the static utility methods from JCasImpl to a new JCasUtil class might be would be worthwhile.  Also there's the trick that EMF uses:  you can't call a method JCas.method() where JCas is an interface, but you can do JCas.UTIL.method(); where UTIL is a static field on the JCas interface.

> Split JCas into interface and implementation
> --------------------------------------------
>
>                 Key: UIMA-10
>                 URL: http://issues.apache.org/jira/browse/UIMA-10
>             Project: UIMA
>          Issue Type: Improvement
>          Components: Core Java Framework
>            Reporter: Adam Lally
>         Assigned To: Adam Lally
>             Fix For: 2.1
>
>
> We should split the existing JCAS class into an interface org.apache.uima.jcas.JCas and its implementation org.apache.uima.jcas.impl.JCasImpl.  This follows good design practices and also is consistent with the rest of uimaj-core.  It is important to do this prior to our first release since it will be a non-compatible change for user code.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Re: [jira] Commented: (UIMA-10) Split JCas into interface and implementation

Posted by Adam Lally <al...@alum.rpi.edu>.
On 12/28/06, Marshall Schor <ms...@schor.com> wrote:
> Adam Lally (JIRA) wrote:
> > I still think that moving the static utility methods from JCasImpl to a new JCasUtil class might be would be worthwhile.  Also there's the trick that EMF uses:  you can't call a method JCas.method() where JCas is an interface, but you can do JCas.UTIL.method(); where UTIL is a static field on the JCas interface.
> >
> Is the filler of JCas.UTIL a reference to the JCasUtil "class"?  e.g.
>
>      static final class UTIL = JCasUtil.class;
> ?
>
> And is the idea to replace references like:
>       JCasUtil.<some-static-method>(...) with
>       JCas.UTIL.<some-static-method>(...) ?
>

Well, not quite - I don't think that's even valid Java.  The value of
JCas.UTIL would be an instance of some class such as JCasUtil (which
could be split into interface and implementation), and the methods
would be non-static.

> I guess I'm unclear about what goal is being served by doing that?
>

I think the main idea is that it enables the separation of interface
and implementation for what would otherwise be static methods.  And
also there may be some convenience value to the user to have
everything centrally accessible from JCas.

But I'm not saying we should necessarily do this - just pointing out
that EMF does.  My main point is that I'd like it if no public user
code, including JCasGen-erated code, referred to anything in the
jcas.impl package.

-Adam

Re: [jira] Commented: (UIMA-10) Split JCas into interface and implementation

Posted by Marshall Schor <ms...@schor.com>.
Adam Lally (JIRA) wrote:
>     [ http://issues.apache.org/jira/browse/UIMA-10?page=comments#action_12461223 ] 
>             
> Adam Lally commented on UIMA-10:
> --------------------------------
>
> I fixed a few more that you missed -- the example SimpleTextMerger and SimpleTextSegmenter, and the OpenNLP wrapper examples.  The OpenNLP stuff is tricky because it's not in a source directory due to having a dependency on the OpenNLP jars which we don't ship.
>
> The only remaining occurrences of JCasImpl seem to be in JCas-generated classes and from other implementation classes.
>
> I still think that moving the static utility methods from JCasImpl to a new JCasUtil class might be would be worthwhile.  Also there's the trick that EMF uses:  you can't call a method JCas.method() where JCas is an interface, but you can do JCas.UTIL.method(); where UTIL is a static field on the JCas interface.
>   
Is the filler of JCas.UTIL a reference to the JCasUtil "class"?  e.g.

     static final class UTIL = JCasUtil.class;
?

And is the idea to replace references like:
      JCasUtil.<some-static-method>(...) with
      JCas.UTIL.<some-static-method>(...) ?

I guess I'm unclear about what goal is being served by doing that?

-Marshall