|
Re: [CDO] doubts related to model modularity [message #751772 is a reply to message #750766] |
Wed, 26 October 2011 06:45 |
Ed Merks Messages: 33145 Registered: July 2009 |
Senior Member |
|
|
Cristiano,
Comments below.
On 26/10/2011 12:36 AM, Cristiano avi wrote:
> Hi,
> Last week in a talk with a old friend about modeling, he told me that
> a long time ago in a project he had to work with EMF and he had some
> issues related to creation of many sub-packages below the root package
> of one .ecore file. And he have troubles with separating classes
> between more than one bundle (maybe just related to osgi).
>
> Is this is true in recent days with EMF 2.8 and CDO 4.1 ? Is model
> sub-packaging a bad thing ?
Physical nested of packages simply isn't necessary. It's merely a form
of syntactic sugar. The problem with them is that often folks writing
utilities that work for Ecore in general fail to test this aspect,
because it's so infrequently used, and then their utility doesn't work
for this case. As such, it becomes more of a case of syntactic rat poison.
In terms of splitting packages across bundles, that's not a problem and
is of course common practice. That being said, if you have two mutually
dependent packages, you can't split them into two mutually dependent
bundles; bundle dependencies can't be circular.
> Is there any know restriction to EMF/ CDO related to packaging and
> modularity that is worth to know ?
I think I expect the basic ones. Nesting packages is pointless and
probably should be avoided. Mutually dependent things need to be in the
same bundle.
>
> With CDO, can I have more than one related bundles with generated
> model classes (each bundle with its own .genmodel and .ecore files) ?
Yes, of course that's common practice.
> thanks for any word
>
>
> Cristiano
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Re: [CDO] doubts related to model modularity [message #751894 is a reply to message #750766] |
Wed, 26 October 2011 07:40 |
|
Am 26.10.2011 00:36, schrieb Cristiano avi:
> Hi,
> Last week in a talk with a old friend about modeling, he told me that a long time ago in a project he had to work with
> EMF and he had some issues related to creation of many sub-packages below the root package of one .ecore file. And he
> have troubles with separating classes between more than one bundle (maybe just related to osgi).
>
> Is this is true in recent days with EMF 2.8 and CDO 4.1 ?
I fully agree with what Ed already replied. To be more concrete I would have to know what exactly these problems were
about. CDO, like EMF, wants to support both use scenarios, nested packages as well as modular models. If there are
problems (none are currently known) we will certainly fix them quickly.
> Is model sub-packaging a bad thing ?
See Ed's answer. In addition I'd say it is a bad thing if the packages are supposed to have no circular dependencies
because you definitely can not enforce this constraint by means of the Java compiler.
> Is there any know restriction to EMF/ CDO related to packaging and modularity that is worth to know ?
No.
>
> With CDO, can I have more than one related bundles with generated model classes (each bundle with its own .genmodel
> and .ecore files) ?
That's perfectly possible and even recommended. The CDO Gastro example system illustrates this with the separate
inventory and businessday models.
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
Re: [CDO] doubts related to model modularity [message #753033 is a reply to message #751772] |
Wed, 26 October 2011 16:01 |
Cristiano Gavião Messages: 279 Registered: July 2009 |
Senior Member |
|
|
Hi Ed and Eike,
thanks for the answers.
Well, I understand that nested packages is not necessary, but it really help when modeling lots of business entities directly in same ecore file as I'm trying to do. Btw, next prototype scheduled is to create meta-models DSL and use xtext to create the entities.
My friend's trouble was exactly related to the mutually dependency in models in separated bundles. In it's models he have used the bi-directional for each 1-N relationship... so I think if I avoid that I'll be ok. lets try so...
The prototype that I need to do is from a system that is composed by 3 subsystems and each has its own concerns and entities. I've used nested package to separate the business concerns inside a ecore for the subsystem.
I need to ensure that will be easy to extend the model for others subsystems in future...
So, I've created 5 model bundles:
- 1 bundle for Common entities that will be imported by all others;
- 3 bundles(A, B, C), one for each SubSystem. Subsystem A is related to B, so it imports bundle, ecore and genmodel from B.
- 1 bundle for the Application model where is the classe that will be the root containment.
* each bundle has its .ecore and .genmodel
Am I in right path ?
thanks
regards
Cristiano
|
|
|
Re: [CDO] doubts related to model modularity [message #753082 is a reply to message #753033] |
Wed, 26 October 2011 16:19 |
|
Am 26.10.2011 18:01, schrieb Cristiano avi:
> Hi Ed and Eike,
>
> thanks for the answers.
>
> Well, I understand that nested packages is not necessary, but it really help when modeling lots of business entities
> directly in same ecore file as I'm trying to do. :) Btw, next prototype scheduled is to create meta-models DSL and
> use xtext to create the entities.
>
> My friend's trouble was exactly related to the mutually dependency in models in separated bundles. In it's models he
> have used the bi-directional for each 1-N relationship... so I think if I avoid that I'll be ok. :) lets try so...
>
> The prototype that I need to do is from a system that is composed by 3 subsystems and each has its own concerns and
> entities. I've used nested package to separate the business concerns inside a ecore for the subsystem.
> I need to ensure that will be easy to extend the model for others subsystems in future...
>
> So, I've created 5 model bundles:
> - 1 bundle for Common entities that will be imported by all others;
> - 3 bundles(A, B, C), one for each SubSystem. Subsystem A is related to B, so it imports bundle, ecore and genmodel
> from B.
> - 1 bundle for the Application model where is the classe that will be the root containment.
>
> * each bundle has its .ecore and .genmodel
>
> Am I in right path ?
That doesn't sound wrong to me ;-)
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
Powered by
FUDForum. Page generated in 0.61638 seconds