Closed badetitou closed 2 months ago
Using a query seems overkill for a 1-step check (going up or down only once).
This can be done with: childEntity parents includes: parentEntity
.
To lazily compute parents, we could have a method in TEntityMetaLevelDependency
like:
parentsInclude: anEntity
self parentsDo: [ :parent | parent == anEntity ifTrue: [ ^ true ] ].
^ false
There is currently no childrenDo:
for the reverse operation, but this can also be addressed.
not convinced
Maybe a query #allAncestors would be a nice alternative to this ?
Using a query seems overkill for a 1-step check (going up or down only once). This can be done with:
childEntity parents includes: parentEntity
. To lazily compute parents, we could have a method inTEntityMetaLevelDependency
like:parentsInclude: anEntity self parentsDo: [ :parent | parent == anEntity ifTrue: [ ^ true ] ]. ^ false
There is currently no
childrenDo:
for the reverse operation, but this can also be addressed.
The advantage of using a query would be the performances. But I don't know if Benoit need better performances on this for now?
In fact, I do not need this right now. But I thought about it because of the performance aspect. I also can understand if you think it is overkill and do not want to address this issue :) I know it takes time and there are other projects
Ok, until real use case, let's close this
It would be nice if we can be able to assess if an entity is the children of an entity, or its parent. We can rely on the Moose Query infrastructure.
It would be something like:
It would allow to perform check such as, is my class in the package
fr.inria.xxx
without computing allParentsPackages or allChildren of the package.@jecisc do you think it is easily feasible with the current infrastructure of MooseQuery? During a Moose dojo @ClotildeToullec?
Or maybe the idea is useless..