Book a Demo

Author Topic: Node Names in Project View  (Read 2190 times)

Michael_Giroux

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Node Names in Project View
« on: May 25, 2006, 10:44:12 am »
Using 6.1.790
Background:
If I create a new project using the default project template and select only the Class Model, I get a project with a root node named "Model" with a subordinate node "Class Model" and another subordinate node named "System".

Model
..Class Model
....System
....Frameworks

Now if I generate code for the "System" node, I'm getting an invalid java package statement:
package Class Model.System;

Two problems here, a) the space between Class and Model, and the use of upper case letters.

Question #1
It seems that the java package name will derive from the node names, so it seems that I need to rename "Class Model" to something like "com.myco".  Also, "System" should be renamed to be a desired package name.  

Is this the intended use, or is there a more appropriate way to control java package names?

Question #2
If a project defines three packages:
com.myco.utils
com.myco.utils.file
com.myco.utils.date

How should this be defined in the EA project?  Should each of these be defined as a package with name as shown above, or should there be a structure of nested packages that resembles the file system structure?

Code: [Select]

com
..myco
....utils
......file
......date
[/font]

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Node Names in Project View
« Reply #1 on: May 25, 2006, 03:56:36 pm »
The ideal situation is to have one package for each level of your package path.  However you can stop namespace generation at any package by setting it as a namespace root. (See http://www.sparxsystems.com.au/EAUserGuide/index.html?namespaces.htm)

We're also planning on modifying that model pattern so that Class Model is a namespace root when it is imported.
« Last Edit: May 25, 2006, 04:01:38 pm by simonm »