Robert

53%
Flag icon
As demonstrated by the CollectionClassifier example, overloading can easily confound these expectations.
Robert
I've found overloading to often lead to: 1. Questions about the omission of params (what's the behavior of the fewer-parameter variant; i.e., what's the behavior of the other params?) 2. Jumping between the various overloads' javadocs, resolving the differences, and 3. Resorting to inspecting source to see what the difference is. When overloading is necessary, there's usually a much greater burden of clear and comprehensive documentation.
Brian
· Flag
Brian
y. and make sure it's needed. i found some really confusing cases of optional parameters turning into multiple overloads that just made it harder to deal with. i like overloading when it's totally dif…
Effective Java: A Programming Language Guide (Java Series)
Rate this book
Clear rating
Open Preview