Notification of modifications in MooseQuery

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Notification of modifications in MooseQuery

CyrilFerlicot
Hello everyone!

Some month ago I sent a mail asking to ensure that all FAMIXEntities
could answer to all MooseQuery queries. The answer was no because the
community does not want some entities to be able to answer to every
query. (For example to have associations that can answer to navigation
queries).

This bothered me because we already have entities that can answer to
#children, #parents, #toScope:, #atScope:... even if it does not make
any sense.

Now I come back with a proposition to clean this half/half state and
to get a clean model query side.

I discussed these changes with Anne and she agrees with them.

In the current state of MooseQuery we have:
- TMetaLevelDependency used by FAMIXEntity that allow querying the
children, parents, and scopes of an entity
- TEntityMetaLevelDependency using TMetaLevelDependency. It adds the
navigation queries.
- TAssociationLevelDependency using TMetaLevelDependency. It adds some
useful methods to associations for the navigation queries.

We have two changes to propose.

First. It does not make any sense for TAssociationMetaLevelDependency
to use TMetaLevelDependency since an association should not be able to
answer to #children, #parents, #toScope:...

We propose to remove this usage. I did this change in an image and
launched MooseQuery/Chef tests, everything is green.

Second. TMetaLevelDependency does not make any sense when we have
TEntityMetaLevelDependency.

All the methods of TMetaLevelDependency are related to entities.

We propose to copy all the methods of TMetaLevelDependency to
TEntityMetaLevelDependency and remove it.

TMetaLevelDependency has two users: FAMIXEntity and
TEntityMetaLevelDependency. Since we copy the methods to the second
user, there is no problem with it. The biggest change is that now
FAMIXEntity will not implement any Meta trait. It does not need to use
any since all its subclasses should not understand generic queries.
The only change that needs to be done is to move the caches created on
FAMIXEntity to the users of TEntityMetaLevelDependencies.

I tried to apply this changes in a quick and dirty way to an image and
once again all tests seem to pass.

In conclusion, what do we win with this changes? All Famix entities
will only understand the queries they can answer to. FAMIXAssociation,
FAMIXSourceAnchor, FAMIXSourceLanguage will not understand anymore
#children, #parents, #toScope:, #atScope:...

Have a nice day :)

--
Cyril Ferlicot
https://ferlicot.fr
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.list.inf.unibe.ch/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Notification of modifications in MooseQuery

Nicolas Anquetil
Hi Cyril,

thank you for your continued efforts in improving the infrastructure.
This is very valuable and very valued.

Pavel asked something about TMetaLevelDependency and Comments just
yesterday.

All you describe seems quite reasonnable.

But I have an issue with the name of these traits (TMetaLevelDependency
and TAssociationMetaLevelDependency).
I just cannot understand what they mean. I was wondering if we could
find some clearer (simpler?) names ?

nicolas


On 23/01/2018 15:10, Cyril Ferlicot wrote:

> Hello everyone!
>
> Some month ago I sent a mail asking to ensure that all FAMIXEntities
> could answer to all MooseQuery queries. The answer was no because the
> community does not want some entities to be able to answer to every
> query. (For example to have associations that can answer to navigation
> queries).
>
> This bothered me because we already have entities that can answer to
> #children, #parents, #toScope:, #atScope:... even if it does not make
> any sense.
>
> Now I come back with a proposition to clean this half/half state and
> to get a clean model query side.
>
> I discussed these changes with Anne and she agrees with them.
>
> In the current state of MooseQuery we have:
> - TMetaLevelDependency used by FAMIXEntity that allow querying the
> children, parents, and scopes of an entity
> - TEntityMetaLevelDependency using TMetaLevelDependency. It adds the
> navigation queries.
> - TAssociationLevelDependency using TMetaLevelDependency. It adds some
> useful methods to associations for the navigation queries.
>
> We have two changes to propose.
>
> First. It does not make any sense for TAssociationMetaLevelDependency
> to use TMetaLevelDependency since an association should not be able to
> answer to #children, #parents, #toScope:...
>
> We propose to remove this usage. I did this change in an image and
> launched MooseQuery/Chef tests, everything is green.
>
> Second. TMetaLevelDependency does not make any sense when we have
> TEntityMetaLevelDependency.
>
> All the methods of TMetaLevelDependency are related to entities.
>
> We propose to copy all the methods of TMetaLevelDependency to
> TEntityMetaLevelDependency and remove it.
>
> TMetaLevelDependency has two users: FAMIXEntity and
> TEntityMetaLevelDependency. Since we copy the methods to the second
> user, there is no problem with it. The biggest change is that now
> FAMIXEntity will not implement any Meta trait. It does not need to use
> any since all its subclasses should not understand generic queries.
> The only change that needs to be done is to move the caches created on
> FAMIXEntity to the users of TEntityMetaLevelDependencies.
>
> I tried to apply this changes in a quick and dirty way to an image and
> once again all tests seem to pass.
>
> In conclusion, what do we win with this changes? All Famix entities
> will only understand the queries they can answer to. FAMIXAssociation,
> FAMIXSourceAnchor, FAMIXSourceLanguage will not understand anymore
> #children, #parents, #toScope:, #atScope:...
>
> Have a nice day :)
>

--
Nicolas Anquetil
RMod team -- Inria Lille

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.list.inf.unibe.ch/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Notification of modifications in MooseQuery

CyrilFerlicot
On Fri, Jan 26, 2018 at 9:28 AM, Nicolas Anquetil
<[hidden email]> wrote:
> Hi Cyril,
>
> thank you for your continued efforts in improving the infrastructure.
> This is very valuable and very valued.
>
> Pavel asked something about TMetaLevelDependency and Comments just
> yesterday.
>
I talked to him about it. :)

> All you describe seems quite reasonnable.
>
> But I have an issue with the name of these traits (TMetaLevelDependency and
> TAssociationMetaLevelDependency).
> I just cannot understand what they mean. I was wondering if we could find
> some clearer (simpler?) names ?
>
TMetaLevelDependency is now removed. But there is still
TEntityMetaLevelDependency and TAssociationMetaLevelDependency.
Those names were originally given by Anne and Jean-Christophe I think.
Since they have more knowledge than me in the area I did not change
anything. Maybe Anne has an opinion on the subject.
Also, if MooseQuery is used by other projects, renaming Traits can be
quite dangerous. It might break a lot of things. Pharo does not react
well when it tries to use a non-existing trait.

> nicolas
>
> --
> Nicolas Anquetil
> RMod team -- Inria Lille
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.list.inf.unibe.ch/listinfo/moose-dev



--
Cyril Ferlicot
https://ferlicot.fr
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.list.inf.unibe.ch/listinfo/moose-dev