Book a Demo

Author Topic: Namespace root and Java generation  (Read 3560 times)

onewnan

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Namespace root and Java generation
« on: March 02, 2006, 12:08:25 pm »
I reverse engineering packages to Views / Component Views / Component Model / com (/ etc.)  I can't seem to get it to forward engineer right.  If I set the com package to namespace root and also generate code from that, my generated package statements in the Java code lack the com prefix.  If I generate from the Component Model package however, I get a generated directory called  "Component Model" inserted beneath my src directory, with com underneath that--even though Component Model is not selected as namespace root.

How do I get this to round trip?


If I then  "Component Views.Component Model." prefixed to "com.myapp..." in the package statements of the code.  I've

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Namespace root and Java generation
« Reply #1 on: March 02, 2006, 02:50:26 pm »
Setting a package as a namespace root actually supresses namespace generation for that package.  (ie. It is the root namespace)  See http://www.sparxsystems.com.au/EAUserGuide/index.html?namespaces.htm

Once you've done that you'll be able to do the package generation from your com package.

kimballjohnson

  • EA User
  • **
  • Posts: 42
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Namespace root and Java generation
« Reply #2 on: March 30, 2006, 12:01:26 am »
Hello,

I've seen you make references to the namespaces.htm helpfile page several times.

In each case you state a fact about the functionality of namespaces that is nowhere referenced or mentioned on that very sparse page.

Is there anywhere a better and more complete discussion of how namespaces are used throughout EA?

Thanks,

Kimball Johnson

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Namespace root and Java generation
« Reply #3 on: March 30, 2006, 03:24:18 pm »
Hi Kimball,

Perhaps that page doesn't state as clearly as it could how namespaces are used in EA.  There isn't another page about it, but the way namespaces are handled can be described by saying that every package below a namespace root in the model corresponds to a namespace in the code.

Does this help you?

kimballjohnson

  • EA User
  • **
  • Posts: 42
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Namespace root and Java generation
« Reply #4 on: March 31, 2006, 09:04:57 am »
Yes, thank you.

That is confirmation.