D
Daniele Futtorovic
If you have some code like this:
class A
{
static String VERSION = "1.0b";
}
and
class B
{
static String VERSION = A.VERSION;
}
When you use Class B, does all of class A get instantiated?
Does all of class A get put in B's jar?
If so, it suggests you are better off to have a tiny common class and
have A and B reference it.
If someone showed me that code (class B) and told me they didn't intend
to include class A in the runtime, my first question would be: "then why
do you reference it?"
If you want to decouple, decouple properly. Use a common class, a
resource file, a service provider interface, whatever. But don't rely on
intrinsics -- even if in this case those are fairly basic and
well-understood intrinsics. That's just begging for trouble.