commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Timothy James Pinet" <>
Subject COMPRESS-REDESIGN: What is the purpose of the reflection usage in ArchiveStreamFactory and CompressorStreamFactory?
Date Sun, 05 Oct 2008 14:05:59 GMT
Good morning,

Out of curiosity why must reflection be used for the create*Stream() methods in the ArchiveStreamFactory
and CompressorStreamFactory? There is a cast at the end of each method to a corresponding
interface anyway (ex ArchiveInputStream, ArchiveOutputStream, etc) so why cant we use this
knowledge ahead of time and execute on the interface? The current implementation makes it
next to impossible to capture errors being thrown by the constructors of new implementations
since the reflective methods discard any Exceptions and simply return null. 

I would like to know why this design decision was made just in case I am missing something.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message