Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [lesson learned] two packages with the same name
[lesson learned] two packages with the same name [message #399667] Sun, 26 March 2006 22:19 Go to next message
Eclipse UserFriend
Originally posted by: philipp.kutter.credit-suisse.com

Dear all.
I would like to share a lesson learned with all of you.

If you load from Java two packages a.samename and b.samename
then by default, you get samename.ecore and samename.ecore, if
you load the genmodel from it.

This can be corrected in the create genmodel wizard, by calling
the first samenameA.ecore, and the second samenameB.ecore

This, unfortunatly solves all the problem, until a certain point.

What you need to do in adition, to solve all problems that may arrive,
is, that IN ADDITON, you change the "Prefix" option of the corresponding
GenPackage from Samename to SamenameA and SamenameB, correspondingly.


For beginners like me, who try to handle real big and clumpsy legacy
systems,
it would be very usefull, if the importer quickly goes over the package
names,
and then takes as many part of it, as needed to name .ecore and Prefix
uniquely in an automated way. Like this, loading a legacy app with dozends
of a.model, b.model, c.model named packages would result in a correct
GenModel immediatly.

Best, Philipp
another hint [message #399668 is a reply to message #399667] Mon, 27 March 2006 00:40 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: philipp.kutter.credit-suisse.com

After learning what I describe above, we are currently running into
problems with Ns URI and Ns Prefix.

Bottomline, EMF with various packages that end in the same way should only
be used after carefully testing an abstract example.

Especially if the genmodel is reloaded from Java.

Best, Philipp
Re: [lesson learned] two packages with the same name [message #399676 is a reply to message #399667] Mon, 27 March 2006 10:07 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 5587
Registered: July 2009
Senior Member
Hi Philipp,

see my questions inline...


Philipp Kutter schrieb:
> Dear all.
> I would like to share a lesson learned with all of you.
>
> If you load from Java two packages a.samename and b.samename
> then by default, you get samename.ecore and samename.ecore, if
> you load the genmodel from it.
>
> This can be corrected in the create genmodel wizard, by calling
> the first samenameA.ecore, and the second samenameB.ecore
Why must this be corrected?
The GenModel should record the fully qualified package name.
To understand your hint, I'd like to know about the resulting problem...

>
> This, unfortunatly solves all the problem, until a certain point.
>
> What you need to do in adition, to solve all problems that may arrive,
> is, that IN ADDITON, you change the "Prefix" option of the corresponding
> GenPackage from Samename to SamenameA and SamenameB, correspondingly.
Again, could you please describe the resulting problem.
Without your change you'd get for example
"a.samename.SamenamePackage" and
"b.samename.SamenamePackage" which are different names in Java.
Is it a problem with EMFs ImportManager?

Cheers
/Eike

>
>
> For beginners like me, who try to handle real big and clumpsy legacy
> systems,
> it would be very usefull, if the importer quickly goes over the
> package names,
> and then takes as many part of it, as needed to name .ecore and Prefix
> uniquely in an automated way. Like this, loading a legacy app with
> dozends of a.model, b.model, c.model named packages would result in a
> correct GenModel immediatly.
>
> Best, Philipp
>
>
>
Re: [lesson learned] two packages with the same name [message #399689 is a reply to message #399676] Mon, 27 March 2006 17:28 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 26281
Registered: July 2009
Senior Member
Eike,

Thanks for asking these are important questions. As far as I
understand, only the nsURI needs to be unique and it should already be
unique. The prefix on the GenPackage and nsPrefix on the EPackage
should not need to be unique. So it's important for me to understand the
problems that this causes...


Eike Stepper wrote:

> Hi Philipp,
>
> see my questions inline...
>
>
> Philipp Kutter schrieb:
>
>> Dear all.
>> I would like to share a lesson learned with all of you.
>>
>> If you load from Java two packages a.samename and b.samename
>> then by default, you get samename.ecore and samename.ecore, if
>> you load the genmodel from it.
>>
>> This can be corrected in the create genmodel wizard, by calling
>> the first samenameA.ecore, and the second samenameB.ecore
>
> Why must this be corrected?
> The GenModel should record the fully qualified package name.
> To understand your hint, I'd like to know about the resulting problem...
>
>>
>> This, unfortunatly solves all the problem, until a certain point.
>>
>> What you need to do in adition, to solve all problems that may arrive,
>> is, that IN ADDITON, you change the "Prefix" option of the corresponding
>> GenPackage from Samename to SamenameA and SamenameB, correspondingly.
>
> Again, could you please describe the resulting problem.
> Without your change you'd get for example
> "a.samename.SamenamePackage" and
> "b.samename.SamenamePackage" which are different names in Java.
> Is it a problem with EMFs ImportManager?
>
> Cheers
> /Eike
>
>>
>>
>> For beginners like me, who try to handle real big and clumpsy legacy
>> systems,
>> it would be very usefull, if the importer quickly goes over the
>> package names,
>> and then takes as many part of it, as needed to name .ecore and
>> Prefix uniquely in an automated way. Like this, loading a legacy app
>> with dozends of a.model, b.model, c.model named packages would result
>> in a correct GenModel immediatly.
>>
>> Best, Philipp
>>
>>
>>
Re: [lesson learned] two packages with the same name [message #399700 is a reply to message #399689] Mon, 27 March 2006 19:17 Go to previous message
Eclipse UserFriend
Originally posted by: philipp.kutter.credit-suisse.com

Hi, Ed. Hi, Eike.
I will create a test project with all kinds of model, model.model,
model2.model packages and load from the Java source.

After renaming the ecore files, things went well for quite a while,
but after we added many additional projects, extending the packages,
and adding new one with the same name the problems popped up.

The measures we took are described.

The detailed study will follow. I just know that I passed many nights now
fixing the problem in a large project.

Best, Philipp
Previous Topic:Serializable interface and classloader
Next Topic:EMF book tutoral on customizing views and properties
Goto Forum:
  


Current Time: Thu Dec 18 19:44:52 GMT 2014

Powered by FUDForum. Page generated in 0.17085 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software