| [CDO] Possibility to implement custom (de-)serialization for ObjectType JAVA_OBJECT? [message #1826832] |
Fri, 01 May 2020 15:51  |
Eclipse User |
|
|
|
Hi,
Is there any way to customize the (de-)serialization of JAVA_OBJECT types by registering/using an application-provided implementation of the JAVA_OBJECT type?
Thanks & best regards, CLemens
Background: Java's built-in serialization has a high space (and time) overhead, especially for small objects. I am currently working on persisting an existing data model which until now was in-memory only and with the builtin serialization approach I see a fixed overhead per Object of about ~100 bytes, which is to be expected. The model consists of tons of tiny Java Objects (dates, Enums, primitive-wrappers, ...) which however are very dynamic in type and structure - so those 100bytes sum up quickly and I fear DB bloat. The application is quite large, so I would prefer enhancing the serialization approach instead of messing with application code.
I have had great results with Kryo in other projects, if possible I would like to integrate it.
E.g. size in bytes of a small serialized java object: https://tinyurl.com/y7pr3p8y
[Updated on: Sat, 02 May 2020 06:58] by Moderator
|
|
|
|
| Re: Possibility to implement custom (de-)serialization for ObjectType JAVA_OBJECT? [message #1826844 is a reply to message #1826838] |
Sat, 02 May 2020 03:50  |
Eclipse User |
|
|
|
I suspect this is a CDO question not really tagged as a CDO question. In the Ecore model EJavaObject is serialized via org.eclipse.emf.ecore.impl.EFactoryImpl.convertToString(Object) and org.eclipse.emf.ecore.impl.EFactoryImpl.createFromString(String) called from org.eclipse.emf.ecore.impl.EcoreFactoryImpl.convertEJavaObjectToString(EDataType, Object) and org.eclipse.emf.ecore.impl.EcoreFactoryImpl.createEJavaObjectFromString(EDataType, String). So the general way is to define an EDataType and implement the factory method to somehow convert the value to and from a string representation.
|
|
|
Powered by
FUDForum. Page generated in 0.07365 seconds