The Artima Developer Community
Sponsored Link

Interface Design by Bill Venners
Make sure subtypes fulfill the semantic contracts of their supertypes

Advertisement

Interface Design | Contents | Previous | Next

Fulfilling the Semantic Contract


Why Fulfill the Semantic Contract?

That's big fence country up there.

The subfence must be completely enclosed by the superfence. Refer to Collection, Set example from interface extension guideline.

Use Venn diagrams to show the problem of mismatched concepts of semantics by various programmer parties (API designs, clients, service providers) Show a Venn oval with three points in it, p1, p2, p3. Say those points could represent different implementations by 3 different vendors, or 3 subsequent implementations by the same vendor. None of those implementation points will break client code so long as all clients and all service providers have appropriate expectations. As Robert Frost said, "Good fences make good neighbors."


Sponsored Links



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