Re: java serialization alternative
Jeff Kesselman <[email protected]> Sun, 30 Mar 2008 13:35:30 -0400
| Newsgroups | gmane.comp.windows.devel.java.advanced |
|---|---|
| Message-ID | <[email protected]> |
Bob Lee wrote: > On Sat, Mar 29, 2008 at 3:10 PM, Attila Szegedi <[email protected]> wrote: > >> Interesting statement - care to elaborate? I've found that evolving >> the class design is easy with serialization but then, I've been mostly >> adding fields and paid attention that the default value of the field >> is okay for existing serialized object representations. On a single >> object level, it is basically an object-to-(name-value-pair) codec. >> What pitfalls specifically do you have in mind? >> > > Making compatible changes isn't hard. Identifying incompatible > changes, for example if a programmer makes a change to a class but > forgets to consider serialization, is very tricky. This is an issue we will be having to deal with down the line with darkstar based apps. I've been toying mentally with the idea of a tool that would take as input a serialized graph, an old code base, and a new code base, and allow you to work interactively to solve an incompatibilities, hopefully resultign in what is effectively a translation script. Obviously, this is not a trivial thing... Im still musign over all the issues. JK > You simply can't > verify compatibility statically with serialization. The only way to > verify that two classes are compatible is to run them and test them. > You can either keep serialized data around in a file or something, or > you can use a trick like this: > http://crazybob.org/2006/01/unit-testing-serialization-evolution_13.html. > Either approach is a pain in the butt. > > If you use a tool like Thrift, you can check two definitions for > compatibility statically, so for example, you could add a submit check > to your source control system or test suite to detect incompatible > changes. > > Bob > > =================================== > This list is hosted by DevelopMentor® http://www.develop.com > > View archives and manage your subscription(s) at http://discuss.develop.com > =================================== This list is hosted by DevelopMentor® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com