Java 8’s Method References Put Further Restrictions on Overloading

Method overloading has always been a topic with mixed feelings. We've blogged about it and the caveats that it introduces a couple of times: You Will Regret Applying Overloading with Lambdas! Keeping things DRY: Method overloading Why Everyone Hates Operator Overloading API Designers, be Careful There are two main reasons why overloading is useful: To … Continue reading Java 8’s Method References Put Further Restrictions on Overloading

You Will Regret Applying Overloading with Lambdas!

Writing good APIs is hard. Extremely hard. You have to think of an incredible amount of things if you want your users to love your API. You have to find the right balance between: Usefulness Usability Backward compatibility Forward compatibility We've blogged about this topic before, in our article: How to Design a Good, Regular … Continue reading You Will Regret Applying Overloading with Lambdas!

Keeping things DRY: Method overloading

A good clean application design requires discipline in keeping things DRY: Everything has to be done once. Having to do it twice is a coincidence. Having to do it three times is a pattern. — An unknown wise man Now, if you're following the Xtreme Programming rules, you know what needs to be done, when … Continue reading Keeping things DRY: Method overloading

Overload API methods with care – the sequel

I had recently blogged about funny issues that arise when overloading API methods with generics involved: https://blog.jooq.org/overload-api-methods-with-care/ I promised a sequel as I have encountered more trouble than that, so here it is. The trouble with generics and varargs Varargs are another great feature introduced in Java 5. While being merely syntactic sugar, you can … Continue reading Overload API methods with care – the sequel

Overload API methods with care

Overloading methods is a strong concept in API design, especially when your API is a fluent API or DSL (Domain Specific Language). This is the case for jOOQ, where you often want to use the exact same method name for various means of interaction with the library. Example: jOOQ Conditions package org.jooq; public interface Condition … Continue reading Overload API methods with care