Book a Demo

Author Topic: Code sync and directories  (Read 2907 times)

daniel.faensen

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Code sync and directories
« on: November 19, 2007, 09:26:26 am »
I have a question concerning code generation, reverse engineering and location of source files.

I have modeled some classes in EA (V. 7) and created C# files from the code. My model is organized in packages as follows

Logical View
-- Company
---- Product
------ Gui
------ Business
etc.

I set the namespace root to Logical View.
When I created the code EA puts the source files in a folder structure like
Projects\Product\Company\Product\Gui
Projects\Product\Company\Product\Business
etc.
My company's coding styleguides prescribe a structure like
Projects\Product\Company.Product.Gui
Projects\Product\Company.Product.Business
i.e. each namespace that is the root namespace of a component (DLL, EXE, ...) maps to a directory with the same name as the namespace.
How can I convince EA to do it like that?

What I tried was to move the .cs files into "my" folder structure and reverse engineer the code into the model assuming that EA would recognise that the model elements are the same. Unfortunately, it created duplicates of all my classes.
Is there a possibility to link to the code file in the new location?

Thanks

Daniel


Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Code sync and directories
« Reply #1 on: November 19, 2007, 11:28:44 am »
EA can't automatically set filenames like this, but to change filepaths by swapping to a local path and then changing the path of the local path.

http://www.sparxsystems.com.au/EAUserGuide/index.html?localpaths.htm

gpc

  • EA User
  • **
  • Posts: 111
  • Karma: +0/-0
    • View Profile
Re: Code sync and directories
« Reply #2 on: November 21, 2007, 06:18:59 am »
Hi,
EA can't do this automatically for obvious reasons, but ti possible to set the filename (and absolute path) for each individual package or even class - depends on the level of control you need. I haven't set it this way, but I think you could just set the filename property of the package and then the code generator should use that?

Thomas_Arnbjerg

  • EA User
  • **
  • Posts: 80
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Code sync and directories
« Reply #3 on: January 04, 2008, 01:56:52 am »
Hello Daniel.

You could also do a MDA transformation from your current (logical) model into a project (implementation) model.