The Artima Developer Community
Sponsored Link

Interface Design by Bill Venners
Use exceptions to indicate a broken semantic contract

Advertisement

Interface Design | Contents | Previous | Next

Says most time contract should be fulfilled, otherwise its an "optional clause".

Exception Safety: an exception should mean that the object is still usable, unless otherwise indicated in the semantics. I.e., when I ask an object to perform a service and the object throws an exception back at me, I want to be confident that I can subsequently ask the object to do something else for me, or the same thing again later, etc. Gives an opportunity to mention finally clauses, which are executed as exceptions propagate up the stack.

Broken Semantic Contract




Google
  Web Artima.com   
Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use