[threeten-dev] ISO8601 durations and java.time

Klaus Malorny Klaus.Malorny at knipp.de
Thu Sep 12 04:03:57 PDT 2013


On 12/09/13 12:38, Stephen Colebourne wrote:
> Originally, the Period class handled all units from years to nanos. We
> chose to simplify it to just being date-based. Most real use cases are
> date based or time based, and it becomes more difficult to explain the
> rationale behind the class relative to Duration if it includes all
> units. Plus, Period is now a lot smaller and easier to understand,
> especially wrt normalization.
>
> It would be perfectly possible to write a combined class, either
> backed by Duration and Period or standalone. The TemporalAmount
> interface permits such a thing.
>
> Oracle have not currently indicated a desire to integrate with the XML
> Duration class.
>
> Stephen
>

Hi Stephen,

thanks for the quick answer. I am not quite sure about the use cases, maybe you 
are right. Still, the problem is that out there there is a common "data type" 
which is not supported as such, and I think it is a none-neglicable disadvantage 
for usability of the new API. Using own classes for (factually) generic data 
types is a way to solve this, but makes the interaction between libraries among 
themselves and between libraries and application code uncomfortable.

Regards,

Klaus



More information about the threeten-dev mailing list