On 1/4/07, Thilo Goetz <[EMAIL PROTECTED]> wrote:
Adam Lally wrote:
> On 1/4/07, Thilo Goetz <[EMAIL PROTECTED]> wrote:
...
> Another open issue is the createFS method and variants.  I have left
> them off of the view API for now in deference to Thilo's "no
> convenience methods" suggestion, but I'm still a little unsure.
> Basically the situation now is if a user has a view handle and wants
> to create an FS they need to do view.getCAS().createFS(...);

Users will have a CAS around, anyway.  Where else will they have gotten
the view from?  I'm not even sure we need a CasView.getCAS().  In what
situation would it ever be unclear what CAS a view belongs to?  Are you
thinking of passing views instead of CASes to process() calls?


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.

>
> The upside is that it helps make it clear that FS are owned by the
> CAS, not the view.  The downside is that it may annoy users to have to
> put in the getCAS call all the time.  Also is it inconsistent that
> view.createAnnotation(...) *is* on the view API?  This was done so
> that users can create annotations that refer to the Sofa for the view
> they're operating on.

An annotation is created with respect to a sofa, not a view.  Why not do
CAS.createAnnotation(Type, int, int, Sofa) or something?  Then
View.createAnnotation(Type, int, int) would be a convenience method.


Yes, I had wanted to add CAS.createAnnotation(Type, int, int, Sofa) -
thanks for reminding me I had left it off of the Wiki page.  But
still, I think there's even more need for the convenience function
createAnnotation that there is for createFS.  Without it we're left
with
view.getCAS().createAnnotation(type, begin, end, view.getSofa()).

-Adam

Reply via email to