[infinispan-dev] Generalizing Externalizer interface
Manik Surtani
manik at jboss.org
Mon Nov 29 10:42:28 EST 2010
+1
On 29 Nov 2010, at 15:32, Galder Zamarreño wrote:
> As part of https://jira.jboss.org/browse/ISPN-246, we're gonna be making Externalizer interface (http://docs.jboss.org/infinispan/4.2/apidocs/org/infinispan/marshall/Externalizer.html) even more public allowing users to provide their own externalizer implementations.
>
> I had a brief scan and it seems like (or so should be unless it's a very strange externalizer), that all Externalizers are symmetric. IOW, whatever type the writeObject() object is passed, that's the type we return in readObject(). So, I was thinking of generalizing Externalizer to look something like this:
>
> interface Externalizer<T> {
>
> void writeObject(ObjectOutput output, T object) throws IOException;
>
> T readObject(ObjectInput input) throws IOException, ClassNotFoundException;
>
> }
>
> Does anyone have any objections? This would safe a lot of casting in implementations, making externalizers easier to code and type safer.
>
> Cheers,
>
> p.s. This would only be included in 5.x.
> --
> Galder Zamarreño
> Sr. Software Engineer
> Infinispan, JBoss Cache
>
>
> _______________________________________________
> infinispan-dev mailing list
> infinispan-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/infinispan-dev
--
Manik Surtani
manik at jboss.org
Lead, Infinispan
Lead, JBoss Cache
http://www.infinispan.org
http://www.jbosscache.org
More information about the infinispan-dev
mailing list