On 1/4/07, Thilo Goetz <[EMAIL PROTECTED]> wrote:
Adam Lally wrote:
> The process call would take a CAS. Inside the body of the process()
> method there would be no issue, but I'm thinking about other methods
> that the user has implemented that need access to the indexes and also
> need to create new FS. I'm sure there are tons of these. IMO having
> to carry around two object references instead of one would be a pain.
> Would we now require that such methods take both the CAS and the
> CasView as arguments? I'm not so happy with that.
No, the CAS is sufficient. Then call getView() in the method (once, and
cache the result). That's what I would do, anyway.
For multi-sofa annotators, the method may not know which view to get.
So if nothing else the view-name may need to be an argument. I'm
thinking of some general purpose function that, say, looks at a Sofa
and creates Person annotations. I think it would be normal to write
this as annotatePersons(CasView view), so I could call it on different
views if I wanted. If we were only creating annotations then just the
CasView would be sufficient. But if the Person annotations needed to
refer to non-annotation FS that also needed to be created, I'd be
stuck unless:
(a) the framework provides view.getCas()
(b) the framework provides view.createFS()
(c) I have to change my method signature to take a CAS as an argument,
in addition to either the view or the view-name.
-Adam