
Interfaces – An Object-Oriented Contract For Usage
This episode, we look at interfaces. These are not supported by all languages. However, when they are supported, they are very useful. The interface specification allows us to provide language-based constraints for our method signatures. It also is an excellent way to enforce consistancy. Interfaces As A Tool For Consistency The most important result of using interfaces is that they enforce a consistent way to communicate with developers. Any class that uses one of these items will be forced to comply with the defined signatures. The language compiler or validations will let the developer know when they are not following the rules. While there might be empty methods allowed, the developer must specifically handle the method and return an empty... Read more