Extension Methods in Java, Xtend & Scala

Posted by & filed under Coding.

Extending the functionality of classes is trivial: simply use inheritance and add new methods. There are cases where extending classes by inheritance is not practicable, e.g. given final classes like java.lang.String. Another simple way of extending the functionality of classes is applying methods defined somewhere else. Modern languages like Xtend and Scala provide convenient syntax… Read more »