It sounds to me like you are over-complicating things. It is not uncommon to have a separate DTO model for serialization, so simply write a little code to map from your domain model (the comple model described above) to the DTO model (close to the serialization format).
It is possible to write a code-first protobuf implementation, which might also be a good fit here - but I don't know of one for java. Marc On 15 Jun 2011, at 16:07, "gabor.dicso" <gabor.di...@gmail.com> wrote: > Hi all, > > I would like to be able to serialize primitive types platform- > independently. I have hand-written Java data classes and I want to > serialize their primitive fields using a cross-platform framework. > These classes can not be generated, they must be written by hand, > additional code is generated based upon them. Also, serializing the > object as a whole isn't an option either, because the fields sometimes > have to be processed before serializing their values. I have to > serialize the fields separately. It must be made cross-platform > because the values will be stored in a database and they may be read > from other platforms. Creating wrapper PB-objects for each primitive > type is an overhead I must avoid because the operation will be done > very frequently and with large amounts of data. > > I found that Protocol Buffers addresses cross-platform serialization > of objects, but I could not figure out how to use it as a > serialization framework for primitive types (without having > created .proto descriptors). Is it possible to use PB as a cross- > platform serializer-deserializer framework for primitive types? > Thanks, > > Gabor Dicso > > -- > You received this message because you are subscribed to the Google Groups > "Protocol Buffers" group. > To post to this group, send email to protobuf@googlegroups.com. > To unsubscribe from this group, send email to > protobuf+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/protobuf?hl=en. > -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To post to this group, send email to protobuf@googlegroups.com. To unsubscribe from this group, send email to protobuf+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.