Why InputStream Design Is Wrong
It's not just about InputSteam
, this class is a good example of a bad design. I'm talking about three overloaded methods read()
. I've mentioned this problem in Section 2.9 of Elegant Objects. In a few words, I strongly believe that interfaces must be "functionality poor." InputStream
should have been an interface in the first place and it should have had a single method read(byte[])
. Then if its authors wanted to give us extra functionality, they should have created supplementary "smart" classes.
Read full article from Why InputStream Design Is Wrong
No comments:
Post a Comment