Book a Demo

Author Topic: Namespaces  (Read 3459 times)

janigorse

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Namespaces
« on: August 09, 2005, 07:10:49 am »
Hi!

Where can I set namespaces in Enterprise Architect. I generate a C# code from my class model, but the code is generate without namespaces. I checked an option "Generate namespace" in Object Options window (C# specification node) but without success. Can you help me?

Thanks,
Jani

Kaneda

  • EA User
  • **
  • Posts: 38
  • Karma: +0/-0
    • View Profile
Re: Namespaces
« Reply #1 on: August 09, 2005, 09:53:38 am »
create subpackages for the view which contains your diagram (in the project view panle) and place the classes in the packages.

These packages will be interpreted as namespaces, and accordingly namespaces will be generated.
There are 10 types of people in this world. Those who understand binaries and those who don't...

janigorse

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Namespaces
« Reply #2 on: August 09, 2005, 12:18:46 pm »
Thank you very much! You're the best!

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Namespaces
« Reply #3 on: August 09, 2005, 03:35:36 pm »
EA allows packages (including view packages) to be namespace roots.  This means that only packages below that point will be generated as a namespace.  Root packages are always namespace roots.

The namespace root property can be set and cleared by selecting Package Control | Set Namespace Root and Package Control | Clear Namespace Root from the context menu for a package in the project view.

So, if you are ever missing a namespace you are expecting, clear the namespace root.

On the other hand, if you are getting a namespace from a package you don't want to be a namespace, set it as a namespace root.

Simon