top | item 46731518

(no title)

jkhdigital | 1 month ago

Another principle that builds on the other two, and is specifically applicable to Java:

- To the greatest extent possible, base interfaces should define a single abstract method which allows them to be functional and instantiated through lambdas for easy mocking.

- Terminal interfaces (which are intended to be implemented directly by a concrete class) should always provide an abstract decorator implementation that wraps the concrete class for (1) interface isolation that can’t be bypassed by runtime reflection, and (2) decoration as an automatic extension point.

discuss

order

No comments yet.