Groovy Interfaces – Contracts and Polymorphism with 10 Tested Examples
Every mock in your Spock suite, every Gradle task type, every plugin point in a Java shop rests on the same idea: code agreeing on a contract without sharing an implementation. Get comfortable with that idea and half of JVM design falls into place. This guide covers Groovy interfaces end to end: declarations, default methods, SAM types, and closure coercion, through 10 examples tested on Groovy 5.0.6. “Program to an interface, not an implementation.” Gamma, Helm, Johnson, Vlissides, Design Patterns ... Read More
