C
Chris
We publish a library. Some of the methods in the public classes are
intended for consumption by our customers, but others are just for
internal use. Ok, fine, declare those methods protected.
A difficultly arises when we want to access one of these internal-use
methods from a class in another package. Example:
com.mydomain.foo.MyFoo wants to access a method in
com.mydomain.bar.MyBar
So the method has to be made public, which makes it available to our
customers. Not good.
How do people generally handle this? I've been putting a "Do not use,
for internal use only" in the Javadoc for the method, but that's not ideal.
intended for consumption by our customers, but others are just for
internal use. Ok, fine, declare those methods protected.
A difficultly arises when we want to access one of these internal-use
methods from a class in another package. Example:
com.mydomain.foo.MyFoo wants to access a method in
com.mydomain.bar.MyBar
So the method has to be made public, which makes it available to our
customers. Not good.
How do people generally handle this? I've been putting a "Do not use,
for internal use only" in the Javadoc for the method, but that's not ideal.