Management of #queryAll{Direction}Associations

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

Management of #queryAll{Direction}Associations


I have some improvements I would like to make to Moose query and I
would like your approuval.

First. Currently there is:
- #queryAllOutgoing and #queryAllOutgoingAssociations to query all the
outgoing associations of the receiver
- #queryAllIncoming and #queryAllIncomingAssociations to query all the
incoming associations of the receiver

#queryAll{Direction} is based on the properties while
#queryAll{Direction}Associations seems to be more empirical.


^ self queryStaticOutgoingAssociations
    addAll: self queryAllOutgoingInvocations;

I propose two changes:
- Remove the empirical implementation to use only the one based on the
- Deprecate #queryAllIncoming and #queryAllOutgoing. I think
#queryAllIncomingAssociations is a better name, but I can change my
mine if you have a different opinion on that.

Second. To query all the in/out associations with the method based on
the meta-models, there is the use of "FAMIXAssociation
withAllSubclassesDo:" to iterate on the associations and do the
queries for all of them.

I have three problems with that:
- This is not efficient. If an entity can have only 2 incoming
associations it will still try the queries for all the associations in
the image
- This has a role in the circular dependency between FAMIX-Core and
Moose-Query packages because we reference FAMIXAssociation
- If one day we create another project from FAME to represent
something that is not a software model, we will maybe not have
FAMIXAssociation but we might still have associations. And Moose-Query
could still be useful on this project.

I propose to add to TEntityMetaLevelDependency two methods:

    ^ (self allChildrenTypes flatCollectAsSet: #outgoingAssociationTypes)
        addAll: self outgoingAssociationTypes;


    ^ (self allChildrenTypes flatCollectAsSet: #incomingAssociationTypes)
        addAll: self incomingAssociationTypes;

Thus the entities will be ab

Cyril Ferlicot
2 rue Jacques Prévert 01,
59650 Villeneuve d'ascq France
Moose-dev mailing list
[hidden email]