Re: incomplete package definition

Martin Matula <[email protected]> Fri, 28 Nov 2003 19:06:11 +0100
Newsgroups gmane.comp.java.netbeans.modules.mdr.devel
Message-ID <[email protected]>
Hi,
thanks for submitting the issue. The test case identified a bug in MDR - 
references between two different nested packages don't work. I will try 
to fix it ASAP.
But I have a comment to your usage of MOF. First, I think you are 
overusing package nesting in your metamodel. Please note the following 
text from the Package Nesting section (2.3.6.2) of MOF 1.4 specification:
<MOF_SPEC>
A nested Package is a component of its enclosing Package. Since, in 
general, the model elements in a nested Package can be inextricably tied 
to its context, there are some significant restrictions on how nested 
Packages can be composed. In particular,
- a nested Package may not generalize or be generalized by other Packages.
- a nested Package may not be imported or clustered by other Packages.
Nested Packages are not directly instantiable. No factory objects or 
operations are defined for nested Package instances. An M1 level 
instance of a nested Package can only exist in conjunction with an 
instance of its containing Package. Conceptually, a nested Package 
instance is a component of an instance of its containing Package.
Note – The main effect of nesting one Package inside another is to 
partition the concepts and the namespace of the outer Package. Nesting 
is not a mechanism for reuse. Indeed when a Package is nested, the 
options for reusing its contents are curtailed.
</MOF_SPEC>
As you can see, it is not possible to instantiate nested packages. I 
would recommend to design most of the packages as outermost and simulate 
nesting using clustering. The correct Java package structure when 
generating JMI interfaces can be defined using javax.jmi.packagePrefix tags.
Regards,
Martin