You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@uima.apache.org by Marshall Schor <ms...@schor.com> on 2007/05/15 21:12:36 UTC

CAS refactoring for view-shared things

When Cas Views are made, another instance of CASImpl type is created, 
and a great many of its fields are copied from the
base view.

How about an alternate design, which moves all of the fields being 
copied into a new object that is shared by all CASImpls belonging to one 
view?  This would "document" much more clearly which things are shared, 
and which ones aren't, and open the possibility of convenient updating 
of the shared things (should that be necessary) without iterating 
through all views.

Any objects to my making this change while I'm mucking around for the 
JCas updates and the ClassLoader switching support (for PEARs)?

-Marshall

Re: CAS refactoring for view-shared things

Posted by Thilo Goetz <tw...@gmx.de>.
Marshall Schor wrote:
> When Cas Views are made, another instance of CASImpl type is created, 
> and a great many of its fields are copied from the
> base view.
> 
> How about an alternate design, which moves all of the fields being 
> copied into a new object that is shared by all CASImpls belonging to one 
> view?  This would "document" much more clearly which things are shared, 
> and which ones aren't, and open the possibility of convenient updating 
> of the shared things (should that be necessary) without iterating 
> through all views.
> 
> Any objects to my making this change while I'm mucking around for the 
> JCas updates and the ClassLoader switching support (for PEARs)?
> 
> -Marshall

As long as you create something new that's called CASView(Impl), and leave the 
base CAS in CASImpl, I'm all in favor.  Just to be clear: what I don't want
is a new class called CASCommon or such, with CASImpl really implementing views.

--Thilo


Re: CAS refactoring for view-shared things

Posted by Thilo Goetz <tw...@gmx.de>.
Marshall Schor wrote:
> Eddie Epstein wrote:
>> On 5/15/07, Marshall Schor <ms...@schor.com> wrote:
>>> When Cas Views are made, another instance of CASImpl type is created,
>>> and a great many of its fields are copied from the
>>> base view.
>>>
>>> How about an alternate design, which moves all of the fields being
>>> copied into a new object that is shared by all CASImpls belonging to one
>>> view?  This would "document" much more clearly which things are shared,
>>> and which ones aren't, and open the possibility of convenient updating
>>> of the shared things (should that be necessary) without iterating
>>> through all views.
>>>
>>> Any objects to my making this change while I'm mucking around for the
>>> JCas updates and the ClassLoader switching support (for PEARs)?
>>>
>>> -Marshall
>>>
>> The main things in CASImpl are:
>>  -various data heaps (FS heap, Strings, bytes, shorts and longs)
>>  -type system
>>  -index definitions
>>  -indexes themselves (one per view)
>>
>> The heaps cannot be shared. 
> correct
>> The type system can already be shared. The
>> only big thing not  currently sharable are the index definitions. 
> I'm not proposing to share these at this point.
>> It
>> might be possible to shared them, but the current IR design do not
>> separate definition from data, so the code that does the sharing of
>> the definitions between views is a bit complicated. May want to
>> re-implement the IR before doing that.
> Not planning to do this...
>>
>> Moving a common JCas object to the TS sounds like a good idea.
>>
> ok.
> 
> The kinds of things I'm thinking of sharing are the following:
>        this.baseCAS
>        this.ts
>        this.sofa2indexMap
>        this.sofa2tcasMap
>        this.sofaNameSet
>        this.fsClassReg        this.featureOffset
>        this.fsSpaceReq
>        this.creatableType
>        all the Type instances for built-ins
>        all the type codes for built-ins
> 
> Some of these shared things can be shared more widely - one per type 
> system that's used by multiple CASes.
> 
> -Marshall

Sounds good.

--Thilo


Re: CAS refactoring for view-shared things

Posted by Marshall Schor <ms...@schor.com>.
Eddie Epstein wrote:
> On 5/15/07, Marshall Schor <ms...@schor.com> wrote:
>> When Cas Views are made, another instance of CASImpl type is created,
>> and a great many of its fields are copied from the
>> base view.
>>
>> How about an alternate design, which moves all of the fields being
>> copied into a new object that is shared by all CASImpls belonging to one
>> view?  This would "document" much more clearly which things are shared,
>> and which ones aren't, and open the possibility of convenient updating
>> of the shared things (should that be necessary) without iterating
>> through all views.
>>
>> Any objects to my making this change while I'm mucking around for the
>> JCas updates and the ClassLoader switching support (for PEARs)?
>>
>> -Marshall
>>
> The main things in CASImpl are:
>  -various data heaps (FS heap, Strings, bytes, shorts and longs)
>  -type system
>  -index definitions
>  -indexes themselves (one per view)
>
> The heaps cannot be shared. 
correct
> The type system can already be shared. The
> only big thing not  currently sharable are the index definitions. 
I'm not proposing to share these at this point.
> It
> might be possible to shared them, but the current IR design do not
> separate definition from data, so the code that does the sharing of
> the definitions between views is a bit complicated. May want to
> re-implement the IR before doing that.
Not planning to do this...
>
> Moving a common JCas object to the TS sounds like a good idea.
>
ok.

The kinds of things I'm thinking of sharing are the following:
        this.baseCAS
        this.ts
        this.sofa2indexMap
        this.sofa2tcasMap
        this.sofaNameSet
        this.fsClassReg 
        this.featureOffset
        this.fsSpaceReq
        this.creatableType
        all the Type instances for built-ins
        all the type codes for built-ins

Some of these shared things can be shared more widely - one per type 
system that's used by multiple CASes.

-Marshall

Re: CAS refactoring for view-shared things

Posted by Eddie Epstein <ea...@gmail.com>.
On 5/15/07, Marshall Schor <ms...@schor.com> wrote:
> When Cas Views are made, another instance of CASImpl type is created,
> and a great many of its fields are copied from the
> base view.
>
> How about an alternate design, which moves all of the fields being
> copied into a new object that is shared by all CASImpls belonging to one
> view?  This would "document" much more clearly which things are shared,
> and which ones aren't, and open the possibility of convenient updating
> of the shared things (should that be necessary) without iterating
> through all views.
>
> Any objects to my making this change while I'm mucking around for the
> JCas updates and the ClassLoader switching support (for PEARs)?
>
> -Marshall
>
The main things in CASImpl are:
  -various data heaps (FS heap, Strings, bytes, shorts and longs)
  -type system
  -index definitions
  -indexes themselves (one per view)

The heaps cannot be shared. The type system can already be shared. The
only big thing not  currently sharable are the index definitions. It
might be possible to shared them, but the current IR design do not
separate definition from data, so the code that does the sharing of
the definitions between views is a bit complicated. May want to
re-implement the IR before doing that.

Moving a common JCas object to the TS sounds like a good idea.

Eddie