[jsr294-modularity-eg] Nested superpackages

Andreas Sterbenz Andreas.Sterbenz at Sun.COM
Mon Apr 23 12:27:26 EDT 2007


Glyn Normington wrote:
> 
> If so, this would seem to put a restriction on the class names in a nest 
> of superpackages: there must be no duplicates. This is a little 
> surprising as it means unexported internals of a (nested) superpackage 
> can cause problems depending on the content of the parent superpackage.

superpackages are a language construct for information hiding. Nested 
superpackages allow you to partition code within one superpackage. Nested 
superpackages are not designed as a replacement for deployment modules or 
to bundle 3rd party code with the superpackage. As such, having multiple 
types of the same name is not a desirable use case for nested superpackages.

More fundamentally, at the language level each class is uniquely 
identified by its fully qualified name. There are no ClassLoaders or 
similar namespace constructs at the language level. As such, it is not 
possible for multiple types to share the same name. superpackages do not 
change that.

Andreas.



More information about the jsr294-modularity-eg mailing list