fsteeg.com | notes | tags

∞ /notes/adapter-pattern-and-java-interfaces | 2004-08-31 | java programming

Adapter Pattern and Java Interfaces

Cross-posted to: https://fsteeg.wordpress.com/2004/08/31/adapter-pattern-and-java-interfaces/

I just thought that patterns actually do matter even in basic programming education. Consider Java Interfaces. I think it is important to be aware of the general concept of classes having interfaces to really use Java Interfaces. It might be useful approaching it from that side. Reading the chapter on the Adapter Pattern in GOF made me realize Java Interfaces are class adapters in GOF, allowing multiple inheritance only for classes without functionality. And then it really makes sense calling these Interfaces, yet it is unintuitive as a class thereby has many different Interfaces which together are the interface of the class.