The goal of XSnapshot is to provide a complete, easy-to-use but powerful framework for working with the data transfer object pattern in Java, primarily for web applications/web services. The data transfer object pattern itself is a generalization of the value object pattern described in most basic J2EE/EJB books. As it turns out, the latter pattern is applicable to more than just sending/receiving data from entity EJB's; some other examples where it's useful include SOAP services, working with O/R frameworks, and working with presentation layers such as Struts. Some of these use cases have previously been addressed by tools such as the Value Objects module of XDoclet and BeanUtils, but these are quite limited in their functionality. XSnapshot aims to provide a complete solution to defining and working with data transfer classes.
At this stage, XSnapshot is primarily an XDoclet module. It provides a set of XDoclet tags that allow you to define a data transfer class (which we call a snapshot) based on a domain model class (which might for example be a Hibernate-persisted class). Based on the XDoclet markup, XSnapshot will then generate the snapshot class and a helper class that converts between the model class and the snapshot class. XSnapshot also includes a set of classes to help in configuring it at runtime and performing the conversions.
XSnapshot has a number of advanced features not found to our knowledge in any similar framework:
While currently XSnapshot works only as an XDoclet module, we intend to in the next release define an xml descriptor format similar to that of Hibernate to provide an alternative means for defining snapshot classes (and the only one that can work when the original java sources are not available). The XDoclet module will then be refactored to generate the xml descriptors rather than directly generating the snapshot and helper classes.