Skip to main content
This revision made January 05, 2013 22:55, by Anatole


JSR 354 - Design Principles


The following design principles were identified to be useful for this JSR:

  • use Value types (simple immutable types, depending on even simpler immutable types or primitives)
  • Method naming and style in alignment with java.util.Currency, where applicable BigDecimal, unless otherwise recommended by (Oracle) Platform Architects
    • same method name prefixes - getInstance() for factories, other operations modeled after BigDecimalto the extent it makes sense. See JavaFX or other APIs.
    • overall API "feel" shold mirror BigDecimal, unless otherwise recommended by (Oracle) Platform Architects
  • Works acceptably with other JVM languages (Groovy, Scala, Clojure...) most do with java.util.Currency, or BigDecimal, thus integration will be similar.
    • Possibly have to align with OpenJDK and other parts like JavaFX

Open Points

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.getInstance(30, GBP) or similar. Factories may exist separate to this, but should not be the first design option.
Difference compared to previous revision
'''=
JSR 354 -
Design Principlesr/>

The follow
ing design prinDesign principles'''ciples were identified to be useful for this JSR: * use '''Value types''' * Value types (S (simple immutable types, depending on even simpler immutable types or primitives) * Method naming and style in '''alignment with java.util.Currency'''
, where applicable BigDecimal
, unless otherwise recommended by (Oracle) Platform Architects ** same method name prefixes - getInstance() for factories, other operations modeled after imple immutable types, depending on even simpler immutable types or primitives) * Method naming and style in alignment with java.util.Currency, where applicable BigDecimal, unless otherwise recommended by (Oracle) Platform Architects ** same method name prefixes - getInstance() for factories, other operations modeled after BigDecimal BigDecimalto the extent it makes sense. See JavaFX or other APIs. ** overall API "feel" shold mirror BigDecimal, unless otherwise recommended by (Oracle) Platform Architects * Works acceptably with other JVM languages (Groovy, Scala, Clojure...) most do with java.util.Currency, or BigDecimal, thus integration will be similar. ** Possibly have to align with OpenJDK and other parts like JavaFX == Open Points 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.getInstance(30, GBP) or similar. Factories may exist separate to this, but should not be the first design option.
 
 
Close
loading
Please Confirm
Close