In this installment of my Design Techniques column, I describe my process to understanding Java's interface. I talk about multiple inheritance and the diamond problem, polymorphism and dynamic binding, separation of interface and implementation as the spirit of Java, and my ultimate epiphany on how we should think about and use interfaces when we design. (3,500 words)
Object-oriented programming languages offer a rich set of constructs for modeling runtime behavior. Understanding polymorphism is key to designing scalable, plug-and-play architectures. Polymorphism generally removes the "switch" constructs required in languages like C. However, there are occasions with polymorphism when these switch constructs reintroduce themselves. This tip focuses on single and multiple polymorphism, with examples that use Java source code. (1,250 words)