Unfortunately, when using Clojure types, the resulting Java classes will not integrate easily into the S4 model since they don’t implement the standard bean interface and, as a result, could not be easily configured in a Spring configuration file. Furthermore, the standard serialization mechanism used in S4 at the moment, the Kryo serialization library, cannot serialize most of Clojure generated classes and default types, since it is unable to deserialize fields marked as
final
and because it requires argument-less constructors that clojure core types, likeKeyword
do not implement. In fact it makes even impossible to generate a serializable bean using thegen-class
macro since this macro places the state into afinal
field.Clj-s4 solves this issue introducing a new macro
def-s4-message
similar todeferecord
that generates a mutable java bean for the provided field descriptions.
Posted via email from miner49r
No comments:
Post a Comment