Sparx Systems Forum
Enterprise Architect => Suggestions and Requests => Topic started by: Emilio on March 10, 2009, 09:12:43 pm
-
Common cause of grief is namespaces. There are two ways to think of it, one as UML namespaces in a model which works fine for most design roles and Language namespaces which is important for technical designers dealing with languages such as JAVA, C#, etc.
This is particularly useful when you do code generation (to save typing time). The problem is that you expect that when you mark a package with the "Set as Namespace Root" (Code Engineering | Set as namespace root) that you will see that in both the namespace listing and the generated code. Well, WRONG!
In my class model (then I am thinking of assemblies which have a root namespace) I mark each top level that represents an assembly (DLL) as "Set as Namespace Root". So:
= My Model
+ Component View
+ Company.Product.Common
+ Company.Product.Presentation
+ Class Model View
+ Company.Product.Common
+ Company.Product.Presentation
In the class and component model I have marked the Company.product.* packages as namespace roots. The problem is that during code generation, as well as in Settings | Namespaces the namespace root is not taken as an overriding factor (as it should) instead you see them listed (and generated in code) as:
My Model.Class Model View.Company.Product.*
and that is just wrong. You would expect that if you set is as "namespace root" that it will be so (Company.Product.*) thus overriding the default namespace generated by the model hierarchy.