Skip to main content
This revision made January 23, 2012 21:55, by scolebourne

Design principles

  • Value types (Simple immutable types, depending on even simpler immutable types or primitives)
  • Method naming and style in alignment with JSR-310
    • same method name prefixes - of for factories, with for immutable setters, plus/minus etc (and amended if JSR-310 naming is amended)
    • overall API "feel" shold also mirror JSR-310
  • Works acceptably with other JVM languages (Groovy, Scala, Clojure...)


Do we want to include the following as a design principle? There is some debate about whether to use factories, why lock it down?

  • No separate factories for the value types
    • specifically, users should be able to write Money.of(30, GBP) or similar. Factories may exist separate to this, but should not be the first design option.
Difference compared to previous revision
<span>'''Design principles''' * Value types (Simple immutable types, depending on even simpler immutable types or primitives) * Method naming and style in alignment with JSR-310<span style="text-decoration:underline;color:green"> **</span>'''Design principles''' * Value types (Simple immutable types, depending on even simpler immutable types or primitives) * Method naming and style in alignment with JSR-310 <span style="text-decoration:line-through;color:red">'''</span> <span style="text-decoration:underline;color:green">same</span><span style="text-decoration:line-through;color:red">S</span><span style="text-decoration:underline;color:green">me</span>t<span style="text-decoration:underline;color:green">hod nam</span>e<span style="text-decoration:underline;color:green"> </span>tep<span style="text-decoration:line-through;color:red">h</span>p<span style="text-decoration:underline;color:green">r</span>e<span style="text-decoration:line-through;color:red">n</span><span style="text-decoration:underline;color:green">fixes</span> - <span style="text-decoration:line-through;color:red">ple</span><span style="text-decoration:underline;color:green">of for f</span>a<span style="text-decoration:line-through;color:red">s</span><span style="text-decoration:underline;color:green">ctori</span>e<span style="text-decoration:underline;color:green">s,</span>e <span style="text-decoration:line-through;color:red">be</span> <span style="text-decoration:underline;color:green">with</span><span style="text-decoration:line-through;color:red">m</span><span style="text-decoration:underline;color:green">f</span>or<span style="text-decoration:underline;color:green"> immutabl</span>e <span style="text-decoration:underline;color:green">s</span>ore e<span style="text-decoration:line-through;color:red">x</span>e<span style="text-decoration:underline;color:green">tters, </span>pl<span style="text-decoration:underline;color:green">us/m</span>i<span style="text-decoration:underline;color:green">nus et</span>c<span style="text-decoration:underline;color:green"> (and amended </span>plici<span style="text-decoration:line-through;color:red">t'''</span>i<span style="text-decoration:underline;color:green">f JSR-310 naming is amended)</span> *<span style="text-decoration:underline;color:green">*</span> <span style="text-decoration:underline;color:green">overall API "feel" shold also mirror JSR-310 * </span>Works acceptably with other JVM languages (Groovy, Scala, Clojure...) Do we want to include the following as a design principle? There is some debate about whether to use factories, why lock it down? * No separate factories for the value types<span style="text-decoration:underline;color:green"> ** specifically, users should be able to write Money.of(30, GBP) or similar. Factories may exist separate to this, but should not be the first design option.</span> <span>
 
 
Close
loading
Please Confirm
Close