Skip to main content

[JSR-354] Re: Separation of Validity

  • From: Werner Keil <werner.keil@...>
  • To: jcurrency_mail@...
  • Subject: [JSR-354] Re: Separation of Validity
  • Date: Sun, 9 Jun 2013 17:02:22 +0200

All,

Please check 
as opposed to 

The latter finds no result, while "validatable" is translated to "validierbare", so let's not get the typo into the API please.

Cheers,
Werner


On Sun, Jun 9, 2013 at 4:54 PM, Anatole Tresch <atsticks@...> wrote:
Basically the setters could go somewhere else. In ext there could be something like a ValidateableCurrencyUnit as user api for returning currencies with validity information attached. Exhangerate would also implement this interface...

I suggested the interface as implementable abstraction, which would match currencies, amounts and rates, but possibly also other types, even outside the jsr's scope. If we are adding validity by inheritence or usage, is still arguable, but for the core part i suggest not to implement it to keep the core simple.

Cheers
Anatole
-
Anatole Tresch
Glärnischweg 10
8620 Wetzikon
Tel +41 (43) 317 05 30
-
Send from Mobile

Am 09.06.2013 um 15:27 schrieb Chris Pheby <chris@...>:

Hi Anatole,

 

Validateable looks more like an interface for implementers than users of the Money API. I think in the main users would be interested in the getter but the setter on the interface. Is that part of the intention of the split?

 

Regards Chris

 

From: Anatole Tresch [mailto:atsticks@...]
Sent: 08 June 2013 14:39
To: Jsr 354 JavaMoney Public Mailinglist; Mark Davis
Subject: [JSR-354] Separation of Validity

 

Deaar all

 

I was thinking about, how we can separate Validity from the instances, e.g. CurrencyUnit (one of the key feedback points out of the EDR). As attachment find my proposal how we can achieve that:

 

  • The Validity value type defines a validity for any item where it can be used: CurrencyUnit, but also ExchangeRate.
  • I defined another interface Validateable which can be implemented by classes that support validity ranges. I suggest hereby that
    • CurrencyUnit will NOT extend this interface. Basically this leads to a very lean CurrencyUnit, which basically only extends the current Currency class by namespaces, the general legal tender and virtual flags (see also attached interface). As a side effect the implementation of equals/hashCode also gets simple.
    • ExchangeRate would implement this interface.
    • Additionally for the MonetaryCurrencies singleton, within the ext package a ValidatedCurrencyUnit class can be implemented that extends CurrencyUnit with Validateable.
    • Similarly a ValideatableAmount class can be added that combines validity with a MonetaryAmount.

I know that not all details were worked out, but I think, it is worth starting the discussion given the two interfaces attached and the comments above. So the discussion is open!

 

Cheers,

Anatole

 

 

--

Anatole Tresch

Java Lead Engineer, JSR Spec Lead
Glärnischweg 10
CH - 8620 Wetzikon

 

Switzerland, Europe Zurich, GMT+1

Twitter:  @atsticks

Google: atsticks
Phone   +41-44 334 40 87
Mobile  +41-76 344 62 79



[JSR-354] Separation of Validity

Anatole Tresch 06/08/2013

[JSR-354] Re: Separation of Validity

Werner Keil 06/08/2013

[JSR-354] Re: Separation of Validity

Werner Keil 06/08/2013

[JSR-354] Re: Separation of Validity

Thomas Hüsler 06/08/2013

[JSR-354] Re: Separation of Validity

Werner Keil 06/08/2013

[JSR-354] Re: Separation of Validity

Werner Keil 06/08/2013

[JSR-354] Re: Separation of Validity

Chris Pheby 06/09/2013

[JSR-354] Re: Separation of Validity

Werner Keil 06/09/2013

[JSR-354] Re: Separation of Validity

Anatole Tresch 06/09/2013

[JSR-354] Re: Separation of Validity

Werner Keil 06/09/2013

[JSR-354] Re: Separation of Validity

Mark Davis ☕ 06/09/2013

[JSR-354] Re: Separation of Validity

Werner Keil 06/09/2013
 
 
Close
loading
Please Confirm
Close