Skip to content

Next step: 1.6.x JDK 11

Sidi Mohamed EL AATIFI edited this page Feb 21, 2019 · 1 revision

Wishlist for 1.6.x

Clean Up

  • Remove support for older JDKs (< 9) to make it easy to follow/take advantage of new features provided by Java
  • Remove Eclipse JDT, Javassist compiler strategies => promote Janino to the default compiler
  • Remove Illegal reflection access from default implementation
  • Reduce size of the final jar (with deps)
  • Reduce time of unit tests => due to some multi-threaded intensive code generation & class loader leakage tests (need to cause OOME to test our lovely weak references)
  • Streamline the release process (to release more often)
  • Using google java format (not important but we've been using this internally for a while now)

ADD Support for Value Provider

Value provider should make it possible to provide a value to a field from a function that can return arbitrary object value. Then on destination object we can populate fields without source field mappings.

fieldMap("someField", sourceObject -> sourceService.doComplexStuff(source)).add()

Use cases: set current user, language,currency any other contextual data Use services/data fetcher/... to destination

This feature will make it easy to "assemble" complex data object dynamically without much pain.

ADD Support for Efficient caching

Let's imagine we have a complex ProductData object that contains all information needed to be displayed on web page.

Product data should be copied from a deep graph of linked entities (persisted in relational database) within this graph we have prices, stock status (per store?), picture, brochures, descriptions, urls, categories, variants, options, ...

A lot of this data does not change a lot so an efficient cache can be huge gain for performance on the other side some of the fragment of the data change a lot like stocks maybe prices (depending on user/country) ...

the idea is to let Orika know wich ClassMap/FieldMap need to be cached and it can look for destination object in cache instead of calling source again and again.

Why not on the service side using AOP for example (like Spring) ? the problem with those solutions is the granularity: we cache the whole ProductData and also we evict or invalidate the whole even if the life cycle of each piece of data is different huge waste of time/resources

Good caching strategy can divide the hosting bills by many folds !

Any wishes/comments are more than welcomed 😅