Cool use of the TVMs, but...
I think a RuntimeException is better, as TVMs don't generally do IO.
The TermVectorReader.readTermVector is just calling back to the TVM,
so it is appropriate that it throws the IOException since it is where
the IO happens. Implementation exceptions, IMO, are best handled
through RuntimeExceptions, else you are potentially putting
implementation details into the interface. Not sure if an
IOException falls into that category, since it is pretty generic,
but, what do others think?
I suppose we could have a whole fun debate about checked exceptions
versus unchecked. :-)
http://www.javapractices.com/Topic129.cjp
http://java.sun.com/docs/books/tutorial/essential/exceptions/
runtime.html
and on, and on, and on
On Oct 24, 2007, at 7:23 PM, Karl Wettin wrote:
How about allowing IOExceptions beeing thrown from the abstract
TermVectorMapper methods?
The use case is that I want a normalized frequency, and I'd like to
do that by loading the factor from an IndexReader in setExpectations.
I could wrap it in a RuntimeException, I could update the values
later. But TermVectorReader.readTermVector already throws
IOException, so using that feels like the optimal solution to me. Or?
--
karl
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]