commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Gregory <garydgreg...@gmail.com>
Subject Re: FormattableUtils
Date Wed, 04 May 2011 13:33:34 GMT
On May 4, 2011, at 9:02, Stephen Colebourne <scolebourne@joda.org> wrote:

> On 4 May 2011 13:47, Matt Benson <gudnabrsam@gmail.com> wrote:
>> At some point Hen mentioned the idea of a PairFormat class.  I don't
>> think this is a bad idea, but the parsing capabilities of such a beast
>> would be minimal to nonexistent, and it still doesn't seem that it
>> would be configurable in a simple way without doing the equivalent of
>> String.format("", left, right).  At this point I am still not sure
>> what is the right mechanism for providing custom string
>> representations of Pair in the simplest and most elegant possible way.
>>  Have any ideas?

Nothing small and simple. Adding formatting to a pair smells like
mixing a view in a model.

Cleanly separating model and view leads to code that starts to feel
outside the scope of lang. Unless we started to need to format pairs
all over the place.

Btw, isn't a range a pair?

Gary
>
> Not really.
>
> toString(format) does the job of custom formatting pretty well.
> Anything else is a wrapper around that which feels pretty unecessary.
>
> Thus, I'd like to make Pair no longer implement Formattable (BTW, I
> don't think anything in the JDK implements Formattable, so its a weird
> interface).
>
> Stephen
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message