johnzon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Romain Manni-Bucau <rmannibu...@gmail.com>
Subject [DISCUSS] default adapters rework?
Date Fri, 10 Jul 2020 07:42:29 GMT
Hi everyone,

Wonder if we should change a bit our converter (in our mapper)/adapter
(jsonb) handling.

Currently we have a static map of converters and in jsonb layer we create a
map we then merge with mapper converter map.
The part I care particularly right now is the java8 default converters.
They can belong to mapper now we are java 8 based so we should probably
move the ones we can (think maybe Date one can't for backward compatibility
reasons).
However I'd also like to avoid to instantiate them all OOTB, to be concrete
maybe 1 or 2 are useful in apps compared to all the ones we create to be
spec compliant.
My first thought is about creating a lazy map (we only use get or entrySet
I think - to refine but idea is to only override the API we use) behaving
as a standard map but on miss we can lookup the fallback (a but like a
linked list of map in terms of design).
Challenge can be to also lazy load part of the constants - but a "LazyInit"
class with static constant should do the trick there (constant are the
ZoneId for ex).

Wdyt? Do you see alternatives?

Idea is really to boot very fast if you don't use anything from that part.

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message