cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin A. Burton" <>
Subject Re: A Suggestion for Cocoon2 Store
Date Sun, 26 Mar 2000 18:14:16 GMT
Ricardo Rocha wrote:
> Kevin Burton wrote:
> > -1.  Don't return boolean just throw an Exception.  This isn't C and it
> > is proven that eventually people don't catch these.
> > Throw a StoreException or something.
> Hmmm... using boolean instead of throwing an exception is a
> recurrent design pattern in collection operations. For instance,
> Hashtable.remove() returns null for non-existent keys and
> Vector.removeElement() returns boolean instead of throwing
> an exception.
> While I agree with Kevin that return values may be easily
> ignored (thus leading to a careless programming style) it
> appears to me it's also true that the semantics of failure for
> this particular kind of operation isn't that of a "true" error
> condition...

Hashtable and Vector are both totally different than this scenario.  You
are defining the interface and then implementing the interface.  Both
Hashtable and Vector have no persistence on filesystems/JDBC.  

I would rather have a harder time building my code and take the extra
time when the possibility of the equivalent behavior of an Exception
being thrown.


Kevin A Burton (
Message to SUN:  "Please Open Source Java!"
"For evil to win is for good men to do nothing."

View raw message