Hi All,
Tony Morris's discussion of the apparent shortcomings of the PreparedStatement and CallableStatement interfaces, with respect to implementing redundant methods, got me thinking about the design of the Collections framework.
Can anyone explain the rationale behind the design of the List, Map and Set interfaces with respect to mutability. For example, I would expect to see the basic interfaces define the accessor methods and then have subinterfaces, e.g. MutableList, which define the mutator methods. With either implementation I would expect to see some way of determining whether the object in question is mutable, e.g. an isMutable() method or a Mutable marker interface.
Having to implement methods that explicitly throw an Exception to say they've not been implemented seems a little clumsy to me.
Is there a good reason for this design choice that I'm missing?
Further does anyone have any insight into the rationale behind the Statement interface and subinterface designs, which lead to the issues that Tony has highlighted?
I'm very keen to hear your opinions.
Jules