About Hattori

Hattori is a Java framework that greatly simplifies DTO population in n-tier web applications by using Java annotations.

The framework is meant to be used at the Service Layer of an application which needs to send disconnected DTOs to a Presentation Layer for modifications. Given a domain object graph, Hattori can populate a DTO graph in a very clean and simple way, and refresh domain objects when the DTOs are sent back to the Service Layer to persist.

The population process is done by evaluating each Data Transfer Object annotated with the ObjectPopulation annotation, which identifies operations to be executed on the DTO using one of these options: field level annotation rules, field level implicit rules or your own specific per-object defined java code.

Annotation Population Definition (clear)

When a Data Transfer Object has a property annotated with FieldPopulation or CollectionFieldPopulation, the configuration of that annotation will provide the definition of the population rule to apply.

Implicit Population Definition (simple)

When a Data Transfer Object has a non annotated property, an implicit population rule is created: a property with the same name will be assumed to exist in the persistent object and used for population.

Static Java Code Population Definition (fast!)

When a DTO in the population process has a related Static Populator Class implementing the StaticPopulator interface, then a method for population the DTO or a method for the persistent object will be called as needed.

This options is intended for high performance needs.