FAQ   Search   Memberlist   Usergroups   Statistics   Register 
 Profile   Log in to check your private messages   Log in 

Creation of genmodel file modifies package name

 
       forum-omondo.com Forum Index -> EMF Discussion
View previous topic :: View next topic  
Author Message
logularjason



Joined: 17 Jan 2005
Posts: 3

Posted: Mon Jan 17, 2005 8:12 am    Post subject: Creation of genmodel file modifies package name

When I create a new EMF class diagram, I enter the package name com.mycompany.domain. This creates the correct "name" attribute in the corresponding ecore file:



however, after Ormondo prompts me to create a genmodel file, the diagram indicates that it has been modified - saving the diagram updates the ecore file so that "name" only contains the last segment of the package:



Of course, any generated code is placed in the package "domain", not "com.mycompany.domain", as desired.

Why is Ormondo stripping off part of the package name - surely this is not desired behaviour?

I'm using the current free edition with eclipse 3.0.1 under fedora core 3.
Back to top
 
julien
Site Admin


Joined: 16 Mar 2003
Posts: 201

Posted: Mon Jan 17, 2005 8:29 am    Post subject: Re: Creation of genmodel file modifies package name

logularjason wrote:
When I create a new EMF class diagram, I enter the package name com.mycompany.domain. This creates the correct "name" attribute in the corresponding ecore file:
...
however, after Ormondo prompts me to create a genmodel file, the diagram indicates that it has been modified - saving the diagram updates the ecore file so that "name" only contains the last segment of the package:
...
Why is Ormondo stripping off part of the package name - surely this is not desired behaviour?


You should not create a package name with dots. It is required by EMF. So you have to create a package named as "domain" and in genmodel to specify the prefix of the package as "com.mycompany" for code generation.

regards
julien
Back to top
logularjason



Joined: 17 Jan 2005
Posts: 3

Posted: Mon Jan 17, 2005 11:04 pm    Post subject:

I'm surprised by the inability to allow fully qualified package names via the Omondo GUI - it seems to break the standard Java convention for avoiding namespace clashes of class names. Note that the Omondo GUI allows package names with dots to be entered, however it quietly drops the prefix at the genmodel creation step. This seems unsatisfactory.

Note that I can manually create EMF solutions with dots in the ecore "name" element as shown above - seems to work fine.

Simply specifying the package prefix in the genmodel file as you suggest doesn't work, because:

1) Even after I manually update the "Base Package" field in the genmodel file, files like plugin.xml still contain the erroneous data generated by Omondo (e.g. the class name is still domain.DomainPackage), and so the application won't run.

2) I don't get the genmodel file until *after* I've chosen "Generate Model" in Omondo. By this stage, code has been generated into the wrong package, so I need to delete this manually.

Wouldn't it be better for Omondo to accept package names with dots, as it does now, but to produce ecore, genmodel, and java files that are consistent with the users input? Seems like a bug to me.
Back to top
 
logularjason



Joined: 17 Jan 2005
Posts: 3

Posted: Mon Jan 17, 2005 11:31 pm    Post subject:

Also, when Omondo ignores the package prefix, it produces a plugin ID that is not fully qualified, so it's susceptable to clashes with other folk's plugins.
Back to top
 
Display posts from previous:   
       forum-omondo.com Forum Index -> EMF Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


Powered by phpBB 2.0.11 © 2001, 2002 phpBB Group