propensive / rapture

Rapture
183 stars 39 forks source link

Add java 8 time support for json/xml modules #258

Closed mielientiev closed 7 years ago

mielientiev commented 7 years ago

Implementing #257

There are few API design options I see:

  1. Make java8 API generic (based on DataAst) so XML and JSON API could use it. Pros: java8 API module doesn't depend on XML or JSON module. Cons: can't use XML and JSON backends (AST) simultaneously (in a single context) with java8 module. Because of ambiguous implicits.

  2. Make java8 module depends on xml & json module, and divide API in 2 part: (rapture.xml.java8.time._ & rapture.json.java8.time._). Pros: fix first solution issue Cons: java8 module depends on JSON & XML modules. For example, a user adds a java8 module for JSON serialization, but it also gets XML module in the classpath. (Bad practice. IMHO)

  3. Make 2 modules: json-java8 & xml-java8. Pros: fix first two solutions issues Cons: Code duplication.

Currently, I have implemented the 3rd option.

@propensive What do you think?