commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hanson Char" <hanson.c...@gmail.com>
Subject Re: TextIterable ?
Date Fri, 26 Oct 2007 05:47:31 GMT
> a) I hate APIs that force me to think in terms of File/URL and not in
> term of streams. It's like not having piping in unix.

Well then you would certainly hate TextIterable, for it is
intentionally designed to operate at a higher level ie File, Resource,
URL.  No streams.  Just iterate.

As a client of TextIterable, I'd like to play lazy and have
simple/minimal code that just works for me.

> b) The class that opens the stream should close the stream.

Since there is no stream opening in TextIterable, it is intended to
have no closing necessary.  The only exception is when one iterates
half way and decides to quite.  But that is expected to be the less
common use case.

Cheers,
Hanson Char

On 10/25/07, Henri Yandell <flamefew@gmail.com> wrote:
> On 10/25/07, Hanson Char <hanson.char@gmail.com> wrote:
> > Henri,
> >
> > LineIterator is intended/designed to be a hidden implementation behind
> > TextIterable.  It's like putting the cart in front of the horse.
> > Things don't make much sense if LineIterator is taken out of context
> > as a standalone public class - issues of InputStream vs Reader,
> > encoding, closing of input stream, etc. go away at the higher level of
> > abstraction, aka TextIterable.
>
> My personal view is that:
>
> a) I hate APIs that force me to think in terms of File/URL and not in
> term of streams. It's like not having piping in unix.
> b) The class that opens the stream should close the stream.
>
> > The 1.5 issue is, unfortunate, a real issue.  I haven't programmed in
> > pre-1.5 Java for 2+ years now.  Sorry for the folks who are not so
> > lucky.
>
> Yeah, it's a pain in the arse and more; the inability to move the
> libraries to 1.5 slowly kills Commons. Thus you see various
> Collections clones out there starting up with a 1.5 focus. A lot of
> that though is because Collections -> 1.5 isn't something that you
> just wave a magic wand on.
>
> Personally I finally moved to 1.5 in the last year. 1.4 is yesterday's
> trash to me now. As a whole Commons is just about at the point of
> being happy to drop 1.3 support, with new components being 1.5+.
>
> Hen
>
> ---------------------------------------------------------------------
> 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