> Of course, #2 is better than #3 if addMember cannot be changed.
>> Of course, #2 is better than #3 if addMember cannot be changed.
>
> Do you think it would be better to have addMember() throw a Runtime
> exception instead if it cannot be changed?
If it cannot be changed to throw an appropriate exception, with the
implication that any existing code will be changed appropriately, I
would stick with the existing interface and use #2.
Suppose there is an existing user of #2, and addMember is changed to
throw an appropriate checked exception. The #2 code will not compile
until it is changed to deal with the new exception. If addMember were
changed to throw a RuntimeException, the existing #2 code would fail
mysteriously when addMember fails.
Patricia