When to use functional programming approach and when not? (in Java)
- by john smith optional
let's assume I have a task to create a Set of class names. To remove duplication of .getName() method calls for each class, I used org.apache.commons.collections.CollectionUtils and org.apache.commons.collections.Transformer as follows:
Snippet 1:
Set<String> myNames = new HashSet<String>();
CollectionUtils.collect(
…