Book a Demo

Author Topic: Best practices for XMI file naming?  (Read 5994 times)

Ramiro Gonzalez

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Best practices for XMI file naming?
« on: June 02, 2010, 08:08:27 am »
I wonder if there is somewhere any best practices documented about naming the xmi files generated by the "control package" option.

It happens that for each View we have a package named like "Module X", "Module Y", etc. Hence, when we activate the "control package" the XMI Files names are in a collision course (for example “Module Y” in the Design Model is equal than “Module Y” in the Analysis Model).

Any ideas?

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Best practices for XMI file naming?
« Reply #1 on: June 02, 2010, 10:40:09 am »
I have the folder structure on disk mirror the folder structure in the model - that way there's always a 1-to-1 correspondence.

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Best practices for XMI file naming?
« Reply #2 on: June 02, 2010, 03:29:01 pm »
I agree with Paolo, that is exactly the way we do it.
As alternative you could use the qualified name of the package.

Geert

pocketom

  • EA User
  • **
  • Posts: 97
  • Karma: +0/-0
    • View Profile
Re: Best practices for XMI file naming?
« Reply #3 on: June 03, 2010, 12:25:48 am »
I wonder why these (already existing) structures aren't created automatically. Should be an easy feature to reflect package folders for XMI exports.

I have the problem especially for class diagrams, the namespace/package folder hierarchy that already exists in my project browser, but everything is put on the same level by default (package-name.xml files). I need to recreate manaully the hierarchy on filesystem, maintain it manually, and then I need to setup package/version control for each package individually in EA. At the end I'm doing always the same like a robot, I think it should be really possible to add P/V control to a class models namespace root and everything below is setup automatically. But perhaps I'm just to stupid to find out how to achieve that...

So, why does such a mature tool disregard existing hierarchies? Perhaps there is a good reason for it (and I should stop playing robot), but I can't find it in the manual or the Version Control whitepaper. Who can explain?
« Last Edit: June 03, 2010, 12:30:24 am by pocketom »

Frank Horn

  • EA User
  • **
  • Posts: 535
  • Karma: +1/-0
    • View Profile
Re: Best practices for XMI file naming?
« Reply #4 on: June 03, 2010, 12:54:16 am »
Well, I think the reason is that your controlled packages could be imported into different EA projects, and could have completely different places in the package hierarchy within the respective projects.

pocketom

  • EA User
  • **
  • Posts: 97
  • Karma: +0/-0
    • View Profile
Re: Best practices for XMI file naming?
« Reply #5 on: June 03, 2010, 01:48:24 am »
Oh yes, that could be case. But if you have a clear hierarchy, then it should be pssible to chosse from which level in the hierarchy to import?

But anyway, for the "Shared Model" strategy (no partial imports/exports, always whole model), it would be great to have an option in the package control like the well known "Include all Child Packages"  8-)

Perhaps I should make a feature request, but I'm still not sure if this would be a good practice in this case. Perhaps there are other pitfalls?

Ramiro Gonzalez

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: Best practices for XMI file naming?
« Reply #6 on: June 03, 2010, 02:42:49 am »
I agree with @pocketom, EA should manage the structure of the files and names automatically. Or at least, provide a default consistent with the structure of the project.

But having the current default to a simple name in the project root is not the best option.

pocketom

  • EA User
  • **
  • Posts: 97
  • Karma: +0/-0
    • View Profile
Re: Best practices for XMI file naming?
« Reply #7 on: June 08, 2010, 11:24:13 pm »
Has anybody an idea how to create a makro or something like that to generate the structures? A folder for every package would be good for the beginning.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Best practices for XMI file naming?
« Reply #8 on: June 08, 2010, 11:44:29 pm »
Loop all packages, create folder on file system for each package, recurse...

Geert

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Best practices for XMI file naming?
« Reply #9 on: June 09, 2010, 08:30:21 am »
Just a warning.  If you have a reasonably large package structure with descriptive package names this method may result in going over limits for path lengths on your file system.  It also causes problems if you ever rename anything.

(Both reasons contribute to why the version control function 'Add Branch to Version Control' uses a guid based naming scheme.
« Last Edit: June 09, 2010, 08:33:27 am by simonm »

ChrisBD

  • EA User
  • **
  • Posts: 60
  • Karma: +0/-0
    • View Profile
Re: Best practices for XMI file naming?
« Reply #10 on: June 10, 2010, 09:07:34 pm »
We use a mixture of folder structure and a section of the GUID for each item.
This may mean that "PackageB" is stored as "c:\store\ea7\487521A54D.xmI" in the version control, but does it really matter?

With several hundred thousand XMI files we've yet to encounter a problem with duplication.