Hi,
On Sep 18, 2016, at 2:57 PM, Vincent BLONDEAU
<vincent.blondeau(a)polytech-lille.net> wrote:
From: Moose-dev [mailto:moose-dev-bounces@list.inf.unibe.ch] On Behalf Of Tudor Girba
Sent: dimanche 18 septembre 2016 11:09
To: Moose-related development
Subject: [Moose-dev] parentSelectors
Hi,
Hi,
I just saw that the way the parent selectors are being defined was changed. In general,
please announce deep changes like these on the mailing list.
Indeed, I done it last week and didn’t announced it yet on the mailing list.
If I understand correctly, the goal was to make it easier for extensions to specify the
parentSelectors. This is a good goal, but there are two problems with the current
solution:
Yes, there was some problems if you extend the FAMIX metamodel with some classes, as it
is done with Orion. The parentSelectors are in fact not described in the fame metamodel
and cannot be used easily in the subclasses.
1. The parentSelectors should be extensible. Right now, they are defined in one method
returning a collection of strings. Instead, it would be better to have them described
directly in the selector method. For example, we could have:
FAMIXType>>container
<MSEProperty: #container type: #FAMIXContainerEntity opposite: #types>
<MSEComment: 'Container entity to which this type belongs to.
Container is a namespace, not a package (Smalltalk).'>
<MSEParentProperty>
^container
This would also allow us to extend existing classes with annotations that can be
selectors.
2. Right now, the parentSelectors are defined on the instance side as an MSE property:
FAMIXType>>parentSelectors
<MSEProperty: #parentSelectors type: #String>
<multivalued>
^ #(container parentPackage)
This is incorrect given that they describe the type, not the instance. For example, one
consequence is that now we serialize this information (check MooseModel>>testExport
which fails right now). Instead, let’s go for solution from point 1.
What do you think?
I agree that this property is a type property. But, in fame we cannot define such kind of
property. To do it, we can:
- Don’t use the Fame meta model (previous solution)
- Use the instance meta descriptions that are already defined meta model
(current solution bu not the best)
- Define some new properties in the metamodel, as you propose. But in the 2
points suggested, we have to change the MSE importer and the metamodel to take into
account the new pragmas (in “annotation” or in the selectors by MSEParentProperty).
Do you think that is a good idea ?
If, we do that, I think the solution in point 1 is better.
For the current failing test, we can add <derived>. This way the information will
not be serialized
The MSE property is about an instance. So, marking it with <derived> does not work
because we are mixing levels of abstractions.
What we want is to make the selector discoverable through reflection. This is at the level
of Pharo code. So, by annotating the concrete property we can discover them properly and
have subclasses know about them.
Cheers,
Doru
Cheers,
Vincent
Cheers,
Doru
--
www.tudorgirba.com
www.feenk.com
"It's not how it is, it is how we see it."
_______________________________________________
Moose-dev mailing list
Moose-dev(a)list.inf.unibe.ch
https://www.list.inf.unibe.ch/listinfo/moose-dev
--
www.tudorgirba.com
www.feenk.com
"Obvious things are difficult to teach."