Author Topic: namespace in visual studio  (Read 3159 times)

alaino

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
namespace in visual studio
« on: June 20, 2006, 05:15:03 am »
Hello,
I am testing Enterprise architect with Visual studio 2005.
I would like a package hierarchy like this:

Company
__AXInterfaces
____MyClass
__AXLib

The packages AXInterfaces and AXLib are linked each one to a visual studio class library project.
But I have a problem with the namespaces.
For example, I would like that EA generate MyClass in the namespace Company.AXInterfaces. But it generate MyClass without the namespace.

And If I program that in visual studio:
namespace Company.AXInterfaces{
public MyClass{
}
}

And I import source code in EA, it generates the following hierarchy in EA:
Company
__AXInterfaces
____Company
______AXInterfaces
________MyClass
__AXLib
« Last Edit: June 20, 2006, 05:17:01 am by alaino »

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8085
  • Karma: +118/-20
    • View Profile
Re: namespace in visual studio
« Reply #1 on: June 20, 2006, 02:59:59 pm »
Well, it looks like the namespaces are messed up in your model.  Right click on the AXInterfaces package in the project view and under the Code Engineering menu Clear the Namespace root if it isn't already.  (You may also need to do this for the Company package.)

Please see http://www.sparxsystems.com.au/EAUserGuide/index.html?namespaces.htm for more information about how namespaces are handled in EA.

The reverse engineering would have created the second set of packages if you started a directory import from within the AXInterfaces package.  What you need to do instead is to start it from outside the Company package (the root namespace) so that when EA finds a namespace it can create or use the package from that point.