POF Serializer Generator

Features Annotations Future Downloads Changelog Compatibility Presentations

Probably a lot of people were more or less frustrated on the amount of repetitive code one had to write for implementing ExternalizableLite. The introduction of POF did not lessen this amount at all (and property ids mean even more maintenance effort), but with POF one even have to write configuration files for it, too.

Of course POF introduced a number of other features which actually can be leveraged to automate the chore of writing serialization-related code, e.g. the possibility to include configuration files for the mapping of user types to classes, and also the ability to use serializer classes instead of having to implement (de)serialization logic in the cached value class itself (which is problematic to generate).

There were probably many approaches to automate the creation of this code in every Coherence shop. The approaches mostly fall into three categories: either use AOP to add mixins carrying out the (de)serialization tasks in runtime, or use reflection-based code to (de)serialize the attributes or use compile-time code generation to generate either serializers or the actually used class from metadata or a base class not actually used.

My approach is compile-time source and text file generation, as it also allows the generation of additional artefacts. I started writing a Java APT annotation processor which generates serializers to annotated classes and attributes.

You can find its current features on the Features page. The documentation of all the annotations is accessible from the Annotations page. You can find the environments compatible with the generator on the Compatibility page. Planned features are listed on the Future page. The list of changes in the past versions are on the Changelog page.

And of course you can also download it from the Downloads page. The code is just a preliminary version, please take that into consideration before starting to bash my head, but still report any problems you believe to find with it. I welcome reports of bugs, new ideas and any suggestions.

Finally, you can find the slides and sample project for my presentation about this tool at the London Coherence SIG on May 14th, 2009 on the Presentations page.