<div dir="ltr">Michael I see the business case for the Period validation, but the complexity (impossibility) of a reliable comparison between Periods it seems widespread and accepted between the developers. Personally I don&#39;t see the benefits to have it in the spec if it risks to generate confusion or errors.<div><br></div><div>If you have some inputs, these are welcome. Could you enrich your previous example (years, month, days)?<br></div><div><div><br></div><div>Thanks</div><div><br><div class="gmail_extra"><div class="gmail_quote">On Tue, Feb 21, 2017 at 8:51 AM, Gunnar Morling <span dir="ltr">&lt;<a href="mailto:gunnar@hibernate.org" target="_blank">gunnar@hibernate.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>2017-02-20 20:13 GMT+01:00 Michael Nascimento &lt;<a href="mailto:misterm@gmail.com" target="_blank">misterm@gmail.com</a>&gt;:<br>
&gt; On Fri, Feb 17, 2017 at 5:11 AM, Gunnar Morling &lt;<a href="mailto:gunnar@hibernate.org" target="_blank">gunnar@hibernate.org</a>&gt;<br>
&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; &gt; You don&#39;t compare, because they are not the same. The idea is that the<br>
&gt;&gt; &gt; Period must be defined in terms of the units for which you defined its<br>
&gt;&gt; &gt; boundaries.<br>
&gt;&gt;<br>
&gt;&gt; I see. I&#39;m wondering though how practical that will be. Will the<br>
&gt;&gt; developer who puts the constraint always know the structure of the<br>
&gt;&gt; Period set to the field (data set by the application user)?<br>
&gt;<br>
&gt;<br>
&gt; In the case you want it to be validated, you ought to :-)<br>
<br>
</span>But that&#39;s the problem, can you really?<br>
<br>
The actual field values are set at application runtime, e.g. entered<br>
by a user sitting in front of the application. So the application<br>
developer would have to &quot;lock down&quot; whatever can be put in to match<br>
the unit set in the constraint. It&#39;s doable but I&#39;m having doubts that<br>
this constraint pulls its eight eventually.<br>
<span><br>
&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; &gt; You shouldn&#39;t support threeten-extra, but rather arbitrary<br>
&gt;&gt; &gt; TemporalAmounts.<br>
&gt;&gt; &gt; Then threeten-extra just happen to be one of those. There must be<br>
&gt;&gt; &gt; something<br>
&gt;&gt; &gt; like @ChronoUnitMax/@ChronoUnitMin such as:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; @ChronoUnitMax(unit=DAYS, value=1)<br>
&gt;&gt;<br>
&gt;&gt; How would that look like for a Period with several elements set, e.g.<br>
&gt;&gt; &quot;3 months, 2 days&quot;? Would we need a dedicated member in @ChronoUnitMax<br>
&gt;&gt; for each value of ChronoUnit (which are a lot)?<br>
&gt;<br>
&gt;<br>
&gt; What do you mean by a member in @ChronoUnitMax? In my example, I suggest<br>
&gt; using unit as a member, leading to unit and value being the only members.<br>
<br>
</span>By member I meant months(), days(), hours() etc. In the &quot;one unit, one<br>
value&quot; model, how would you express &quot;max 3 month and two weeks&quot;? We<br>
could exclude such case of course, it may sufficiently well be<br>
expressed as &quot;max 10 weeks&quot;.<br>
<span class="m_-3713390949554749298im m_-3713390949554749298HOEnZb"><br>
&gt;<br>
&gt;&gt;<br>
&gt;&gt; We had a discussion of Duration et al. a while ago, but it petered<br>
&gt;&gt; out. So we thought we&#39;d add something to the RI to spark a new<br>
&gt;&gt; discussion. Seems it worked :)<br>
&gt;<br>
&gt;<br>
&gt; CanĀ“t disagree :-)<br>
&gt;<br>
&gt; Regards,<br>
&gt; Michael<br>
&gt;<br>
</span><div class="m_-3713390949554749298HOEnZb"><div class="m_-3713390949554749298h5">&gt; ______________________________<wbr>_________________<br>
&gt; beanvalidation-dev mailing list<br>
&gt; <a href="mailto:beanvalidation-dev@lists.jboss.org" target="_blank">beanvalidation-dev@lists.jboss<wbr>.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/beanvalidation-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailma<wbr>n/listinfo/beanvalidation-dev</a><br>
<br>
______________________________<wbr>_________________<br>
beanvalidation-dev mailing list<br>
<a href="mailto:beanvalidation-dev@lists.jboss.org" target="_blank">beanvalidation-dev@lists.jboss<wbr>.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/beanvalidation-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailma<wbr>n/listinfo/beanvalidation-dev</a></div></div></blockquote></div><br></div></div></div></div>