commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sebastian.Petzelber...@aformatik.com
Subject Antwort: Re: [IO] encapsulating open/close
Date Fri, 06 Aug 2010 08:54:34 GMT
>Not sure if this is exactly what you're looking for, but have you
>seen the AutoCloseInputStream [1] class?

No, I haven't, because IO does not use this itself.

My suggestion is providing an interface and a convenience method, which an
expression of this interface als argument. In this method opening and
closing will be done. I think, this would be the natural way in java. When
closures came, the client code will look short.

I have explained this here:
http://www.aformatik.de/blog/blog-post/2009/11/09/refactoring-snippet-closure.html

Sorry, this is in german, but you could see the code, specially from the
example "praktisches Beispiel". This is just the idea, closing has to be
worked out.

Sebastian Petzelberger


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


Mime
View raw message