The Artima Developer Community
Sponsored Link

Interface Design by Bill Venners
Chapter 4
The Semantic Contract

Advertisement

Interface Design | Contents | Previous | Next

The Guidelines:

Could mention that I didn't specify the details of the hashcode method algorithm in class Matrix, because I wasn't sure I was using a good algorithm and wanted to be able to change it later. If I did eventually decide, I could specify the exact algorithm in the javadoc, as is done for String, Boolean, Long, Double, Integer, and so on. Perhaps this goes in Packages and Evolution, in a discussion of how contracts do in practice get changed, or at least clarified, in future releases, and that you just consider how many clients will in practice have their code broken. If the pain will be slight in comparison to the gain (if the ends justify the means), in the real world you make those kinds of semantic contract changes.


Sponsored Links



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