In my time of digging around Java APIs I have come across both impl and internal packages. Up until now I never really thought about the difference - as with all enterprisey Java apps, I figured they just meant that "actual implementation in here; you (开发者_运维知识库API user) should be really using the interface. Go away."
A little bit of digging around Stack Overflow seems to suggest that the internal package at least can have some security placed around it.
So, what is the difference? I don't think it is a matter of taste because I have seen APIs with both.
The package name has no implication on the runtime behavior. It is just a matter of taste. Some modularity systems like OSGi, give you tighter control in the manifest file over what's visible vs. not to downstream module, but that's all done explicitly not via naming convention. At least in OSGi circles, "internal" is the established naming convention over "impl". Lexically it is more general than "impl" so by extension more broadly applicable... Everything that code outside the module should not touch.
精彩评论