A Nomin mapping listing is nothing else as a groovy class or script. So you are able to use all mechanisms Groovy provides. Although you may not know Groovy at all you can easily use Nomin.
In the majority of cases a mapping rule is looking as usual assignment. For example,
a.name = b.firstName
means "map property 'name' of the first class to property 'firstName' of the second class and vice versa"
In other words now you can map result of calulating arbitrary block of code to properties. Expressions have access to objects being mapped and will be calculated at runtime.
So there is the ability to map result of method invocation on some property.
Nomin can automatically create mapping rules between properties of the same names.
You can choose a class introspector, advise the engine what is the type of a property with hints including dynamic hints which are calculated at mapping time. You are not restricted to use only JavaBeans naming convention, you can use anything suitable for your needs.
Sometimes it needs to perform pre and/or postprocessing entities being mapped. So that code can be placed right in a mapping.
Expressions and hooks can use objects from the context passed to the mapper. Context can be just a Map instance with string keys. Also there is integration with Spring, so you are able to use beans defined in the Spring context.
Nomin is developed for working in multi-threading environments. Its performance exceeds performance of frameworks with the same functionality, the following table show the comparison results.
Environment / framework | Nomin 1.1.0 | Dozer 5.3.1 |
Mapping complex objects, 400000 iterations | ||
Pentium Dual E2180 2GHz, RAM 3 GB Win 32 XP SP 3, JVM 1.6.0_18 | with ReflectionIntrospector ~5.51 s with ExplodingIntrospector ~4.96 s with FastIntrospector ~3.49 s | with disabled statistics 60.93 s |
AMD x64 2GHz, RAM 2 GB Win 7 x64, JVM x64 1.6.0_22 | with ReflectionIntrospector ~4.33 s with ExplodingIntrospector ~4.17 s with FastIntrospector ~3.68 s | with disabled statistics 33.87 s |