[infinispan-dev] Preliminary implementation for ISPN-244 and improvement suggestions.

Sanne Grinovero sanne.grinovero at gmail.com
Wed Dec 8 18:11:09 EST 2010


I'm liking Elias's suggestion to define the ids in xml, at least I
would have a single place where I can clearly see
and inspect usage of my used ids; btw having the map logged in
readable format at startup would be nice.
However getTypeParameters()[0] seems to me insufficient as for the
requirement to reuse each externalizer for multiple cases.

I'd rather use Galder's original proposal to have type(s) and ids
provided by the class, but the ids would be a default only,
especially useful for the autodiscovered externalizers, and then let
the user override all ids in the XML if he wishes so.

Cheers,
Sanne

2010/12/8 Elias Ross <genman at noderunner.net>:
> On Wed, Dec 8, 2010 at 1:05 PM, Mircea Markus <mircea.markus at jboss.com> wrote:
>> Isn't this possible even now through XML?
>> <marshallable id="456" typeClass="com.acme.Person"  externalizerClass="com.acme.SameExternalizer"/>
>> <marshallable id="457" typeClass="com.acme.HotPerson"  externalizerClass="com.acme.SameExternalizer"/>
>
> There are a few things that came to mind here:
>
> 1. In terms of assigning IDs, it needs to be fairly clear there's no
> "global" conflict and having IDs at the annotation level makes it a
> bit unclear what actual number goes with what class. Additionally,
> Infinispan (and users themselves) might want to provide externalizers,
> and unless there's assigned ranges to those teams, putting the ID
> within the annotation it somewhat difficult to reuse these classes.
> How would a team provide a combined cache from two separate instances
> that happen to use different externalizers with the same ID?
>
> Still, having ranges reserved by Infinispan itself would make sense.
> If at all possible, I would restrict them to less than, say 64 or 32,
> thus allowing custom types to be passed as byte values.
>
> I feel having the IDs in one place also makes things easier to debug.
> For network analysis, it's helpful as a reference.
>
> 2. Can't the configuration be simply:
>
> <marshallable id="456" externalizerClass="com.acme.SameExternalizer"/>
>
> and then you simply call SameExternalizer.class.getTypeParameters()[0]
> to determine the type class?
>
> _______________________________________________
> infinispan-dev mailing list
> infinispan-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/infinispan-dev
>



More information about the infinispan-dev mailing list