--Thanks for you help
You received this message because you are subscribed to the Google Groups "protostuff" group.
To unsubscribe from this group and stop receiving emails from it, send an email to protostuff+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Olivier
--
You received this message because you are subscribed to the Google Groups "protostuff" group.
To unsubscribe from this group and stop receiving emails from it, send an email to protostuff+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
static {
RuntimeSchema.register(A.class, new ASchema());
RuntimeSchema.register(B.class, new BSchema());
}
--
You received this message because you are subscribed to the Google Groups "protostuff" group.
To unsubscribe from this group and stop receiving emails from it, send an email to protostuff+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I just understand that indeed protostuff is used: you are saving the class name in order to understand which class was saved in the map. And as we registered the schema for this class, you re able to read it.What is sad is when you are using generic or a field, you can understand the data even if the class has changed as soon as the schema is using the same identifier (name and LongName)
but for collection using Object, you dont support anymore this feature.Am I right?It could be cool to registered a schema without the target class, use the Longname as the metadata for the map. When reading the serialized data, read this metadata, retrieve the schema registered and they create the object with the newMessage() method. with this method you dont need to save the real classname (and allow changing the classname or move the class to another package) with no impact
--
You received this message because you are subscribed to the Google Groups "protostuff" group.
To unsubscribe from this group and stop receiving emails from it, send an email to protostuff+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I dont want to change the type, i want to support a class rename or a class move but you can view this as a field class change. In my case, i keep the same schema but the new schema use the new class.
If the map was using the schema long name from method messageFullName() as a metadata, supporting renaming would work.
Let me explain this with an example:You have a Map<String, Object>You have a class A with a schema named SchemaA where the method messageFullName() returns "SchemaA"You would registered the schema SchemaA using this full name somewhere. When saving the map, instead of using the long class name, you would save the messageFullName().Imagine now you Rename your class A as NewA. The SchemaA is still returning "SchemaA" when calling messageFullName(), but now the newMessage() method create a NewA instance.When reading the map from protostuff serialization, you see "SchemaA" as the metadata class, you can now retrieved the right schema and read the data in a NewA instance. You are able to support class renaming and class package
--
You received this message because you are subscribed to the Google Groups "protostuff" group.
To unsubscribe from this group and stop receiving emails from it, send an email to protostuff+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to protostuff+...@googlegroups.com.