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