Closed JooHyukKim closed 1 year ago
Looks good so far. You may want to look at standard MapSerializer
to see how to maybe try to add full typed handling (or even partial). That requires constructing instances with resolved JavaType
to know actual declared types of Key and Value types, instead of assuming Object
. Doing so is required at least for polymorphic types (wrt values), but also to support some key types like java.util.Date
where Object.toString()
is not what regular Map
serializer would use.
I think what I would want to see is at least extracting and passing JavaType
.
Now that wrote above, though, I realize that this is not as trivial as thought because Cache
is not Map
and as such does not automatically extract generic type information.
But! Have a look at GuavaTypeModifier
and see how it "upgrade" Multimap
into "map-like" type: I think same should be done for Cache
. And see how Multimap
's generic type information is then available and used in GuavaSerializers
method findMapLikeSerializer()
.
This is the good way to get type information.
I am ok with not necessarily implementing everything this allows, but at least get type information so handling may be improved.
LMK if you need help here, type refinements are pretty advanced functionality.
Looks good so far. You may....
Thank you for your detailed feedback on the PR ππΌ I will work on it one by one and get back soon as I can~
Looks good @JooHyukKim. Is this ready to be merged from your end? (just want to make sure I won't merge too early).
Looks good @JooHyukKim. Is this ready to be merged from your end? (just want to make sure I won't merge too early).
Yes, it is ~ ππ½ββοΈππ½ββοΈ
@cowtowncoder Thank your details reviews as always ππΌππΌ
One question tho, is it reasonable to move on to implementing CacheDeserializer? Or you might have some plan to write some set up code like you did with serializer.
@JooHyukKim I'd guess users would want a deserializer too, yes, so +1 for that. I don't think "empty" implementation would be useful here.
relates to #90. "Miminal" implementation of
Cache
serialization.