r/java•
nerdwaller

How to organize projects with custom lambda interfaces?

I just started toying around with Java8's new features (streams and lambdas, mostly). I've found some uses for lambdas, such as running the same logic flow but doing various things with the end depending on what I am trying to accomplish. All that is really nice to add, but it brings a new challenge to project organization (which I sometimes struggle with anyway).

The question: I am not sure of the best way to organize projects now, since custom lambdas often need @FunctionalInterfaces (obviously except where otherwise provided in the stdlib). Is there a good standard for how to organize these new tools? It seems unnecessary to have a file per functional interface since they can only have 1 method, but they are otherwise cluttering up other classes and I am not sure of the happy medium.

Any good ideas out there?

Posted Jul 9, 2014, 12:09 AM UTC

64
Loading comments…