Book a Demo

Author Topic: Set package as Namespace Root  (Read 4691 times)

PatrickJ

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Set package as Namespace Root
« on: May 09, 2006, 07:53:56 am »
Hi
I red in the EA Help that is possible to set a package as Namespace Root but I don't find the propertie "Set as Namespace" maybe I should configure something else???

thomaskilian

  • Guest
Re: Set package as Namespace Root
« Reply #1 on: May 09, 2006, 01:39:47 pm »
Context menu in the Project View/Code Engineering/Set as Namespace Root

PatrickJ

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Set package as Namespace Root
« Reply #2 on: May 09, 2006, 11:14:32 pm »
O.K. thank you but rigth now i got a new problem because the code genarator build the class without any Namespace but I'd like to set a reference ta a package with a special Namespace. Is there any possibilitys

thomaskilian

  • Guest
Re: Set package as Namespace Root
« Reply #3 on: May 10, 2006, 12:35:50 am »
Can't help much with that, but search this board for Namespace. There are some threads which might help to solve your problem.

PatrickJ

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Set package as Namespace Root
« Reply #4 on: May 10, 2006, 01:32:23 am »
Sorry but I don't find any thread...
So I explain it twice:
I've got a Package called "ClassDiagramm" in this Package all my classes are defined.
When I start the code genrator it makes a file like this:

namespace ClassDiagramm
{

 public class Class1
 {

...

So I made the Package (ClassDiagramm) as Namespace Root like you told me. After this I still start the code generator and it genarate this code:

public class Class1
{

...
without any Namespaces.

But I'd like to generate code like this:

namespace MyDefinedNamespace.SpecialNamespace
{

 public class Class1
 {

...

so my question what's are settings when the Classes in pakage "ClassDiagramm" generate with my special Namespace???

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Set package as Namespace Root
« Reply #5 on: May 10, 2006, 03:18:06 pm »
If I understand you correctly, you want to have Class1 inside the package ClassDiagramm, and have it generated in the namespace MyDefinedNamespace.SpecialNamespace.  Doing that isn't possible in EA at the moment.  A package is either a namespace root (no namespace is generated) or not (a namespace is generated to match the package name).

Disclaimer: Where I said "isn't possible" above I was referring to direct generation while keeping synchronisation capabilities.  It would actually be very easy to add a tagged value to the package and change the templates to directly generate it or transform it to the required package structure before generating.