Sparx (quite rightly, in my view) recommends that if the platform specific language you are code engineering has namespaces, then you should import the source directory creating a package per namespace.
In another posting
Re: POSSIBLE BUG: Namespaces in C# code I observe the perennial problem of UML - that packages are
namespaces not
folders.
Elsewhere (
Classifier Name, GenFile and GUIDS ) Midnight observes that UML's definition of namespace doesn't fully align with various platform specific languages' definitions of namespace.
EA (of necessity) has introduced the concept of Namespace Root (in order to map a point in the UML hierarchy, with a value in a code file).
If you reverse engineer based on creating a package per namespace, there is no provision for grouping the classes beneath the namespace package. If you create a package and move some classes there, the next time you synchronize, the classes are moved back out. It is possible to have hundreds of classes under one namespace.
I am therefore proposing that EA add the notion of a
Grouping Only package that means "does not participate in the namespace".
Say I have the following structure:
System
....SubSystem
........Component - declared Namespace Root
............Namespace1
...............Namespace2
....................Grouping1 - declared Grouping Only
................Grouping2 - declared Grouping Only
If a class A exists in package Namespace1 and the code has the statement
namespace Namespace1 Then synchronisation will leave it where it is.
If I move it to Namespace2 (but leave the code as is) then Synchronization will move it (back) to package Namespace1
If I move it to Grouping2 (but leave the code as is) then Synchronization will leave it in package Grouping2 (because Grouping 2 is still "in" Namespace1).
It should be noted that the effect of declaring a package as a Namespace Root, is to make all the higher packages "Grouping Only". I'm just re-using the concept lower down.
Thoughts? Votes?
Paolo
[size=0]©2006 Paolo Cantoni, -Semantica-[/size]