[jboss-dev-forums] [Design of JBossCache] - Re: Common marshalling infrastructure
galder.zamarreno@jboss.com
do-not-reply at jboss.com
Thu Mar 19 16:31:30 EDT 2009
Hey David, I've started to look into how to integrate JBoss Marshalling into JBoss Cache. Here's a list of things I wanted to ask you about:
1.- Would it be possible to upload source jars to the maven repo for next release?
2.- Looking at JBoss Marshalling, I saw that you're considering primitive arrays as known classes but primitive object arrays are not. Is this an oversight or on purpose? i.e.
map.put(Byte[].class, Protocol.ID_BYTE_ARRAY_CLASS);
| map.put(Boolean[].class, Protocol.ID_BOOLEAN_ARRAY_CLASS);
| map.put(Character[].class, Protocol.ID_CHAR_ARRAY_CLASS);
| ...
3.- Looks like collections like ArrayList, LinkedList, Hashmap, TreeMap...etc are treated as Serializable objects whereas JBoss Cache treats them differently. Instead, we look through the collection and see if it's an object we might want to marshall it in a diferent way to standard Serialization, i.e. a list of ReplicableCommand (ReplicableCommand does not implement Serializable). How would we deal with this?
4.- Also, JBC treats SingletonList instances separately by just copying the single object within them. Any plans to add this to JBoss Marshalling as well?
Other than this, JBoss Marshalling seems to contain the rest of optimisation JBC did for known type arrays, repeated objects, null values...etc. So, in spite of agreeing with Jason's statement in https://jira.jboss.org/jira/browse/JBCACHE-1336 earlier today:
anonymous wrote : It might be more useful to define type marshallers outside of the type since most of our magic numbers apply to types not under our control (JDK types).
I don't think this might apply any longer if the above points can be resolved. IOW, all types that are not under our control would already be handled by JBoss Marshalling which means that we can concentrate on our types and we could then use @Marshallable annotations.
FAO Manik: We talked earlier about the possibility of externalising magic numbers to a properties or XML but if we can stick to annotations, I think it would be cleaner and more natural. We could also make, @Marshallable inherited (http://java.sun.com/j2se/1.5.0/docs/api/java/lang/annotation/Inherited.html), then annotated subclasses would be covered and you'd be able to override the magic number if you needed different marshalling.
Thoughts?
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4219617#4219617
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4219617
More information about the jboss-dev-forums
mailing list