Coder Social home page Coder Social logo

Comments (14)

NicolasAnquetil avatar NicolasAnquetil commented on July 17, 2024

description of the issue?
Not clear what is meant

from famix.

jecisc avatar jecisc commented on July 17, 2024

This was to reify type declarations as associations

from famix.

NicolasAnquetil avatar NicolasAnquetil commented on July 17, 2024

Ah yes. Reification is needed. But creating an object for this could be costly in memory.
In the old query system, the queries created "fake reification" on the fly.
This could be a better solution ?

from famix.

jecisc avatar jecisc commented on July 17, 2024

The problem is that the MM does not know about this dependencies and we have to introduce a lot of hack in the query system of Moose in order to be able to query those relations. I don't think the memory we save is worth the extra complexity it brings.

from famix.

anneetien avatar anneetien commented on July 17, 2024

from famix.

jecisc avatar jecisc commented on July 17, 2024

Since they are not reified as an association, the meta description does not know it is an association, there is no 'source' or 'target' and thus we need to search for them by hand, add them to the query results etc.. This makes the code of Moose Query more complexe and we cannot do everything we can do with other associations with type declarations since they are not reified.

from famix.

jecisc avatar jecisc commented on July 17, 2024

Another example of a problem caused by the fact that it is not reified is that it will not be possible to create navigation queries on them with the query model Clotilde is doing.

from famix.

badetitou avatar badetitou commented on July 17, 2024

I know we can have hacks etc.
But it is a bad idea because it will certainly introduce bugs.
So reify type declaration looks like a good idea for me too.

Sometimes it is interesting to not use association, but we have to be sure at 100% that we will not need them with Moose Query.
IMO it is only for users models and not the one we proposed.

from famix.

anneetien avatar anneetien commented on July 17, 2024

from famix.

NicolasAnquetil avatar NicolasAnquetil commented on July 17, 2024

May be we can do it without reifying the dependence and without creating a hack to?

We decide that dependence is a strong "property"that we want to be able to always compute.
(seems a reasonable assumption to me)

We create "marker"of relations (in the sense of FamixMetamodelGenerator>>defineRelations) that create depedencies.
e.g. (tTypedEntity property: #declaredType) isDependency

(note that all properties are not dependencies even if they have opposite entities, e.g. comment are sourceAnchor are not)

then we change queryOutgoingDependencies to collect all these relations.
The from is the entity having the relation, and to is the entity in the property.

That would solve moosetechnology/Moose#2303 and moosetechnology/Moose#2304 also

from famix.

NicolasAnquetil avatar NicolasAnquetil commented on July 17, 2024

Note: this could imply

  • either generalizing MooseQueryTypeDeclarationAssociation which is specific to the declaredType property
  • or removing it because we would allow non associations to deal with the isSource / isTarget mechanism
  • or may be a bit of both

At this moment in history, the 2nd option looks like the most promising, least disturbing to me

from famix.

NicolasAnquetil avatar NicolasAnquetil commented on July 17, 2024

First analysis, possible steps :

  • look at TEntityMetaLevelDependency>>dependencyFM3PropertyDescriptionIn: so that it returns all properties that relate to other entities (relations in FamixMetamodelGenerator parlance)
  • review the isSource / isTarget mechanism so that for these properties we can define the owner as source and the content as target (whereas associations have 2 properties one being the source and the other the target)

from famix.

anneetien avatar anneetien commented on July 17, 2024

It seems that the relationQuery have solve this issue.
What do you think @badetitou @NicolasAnquetil?
Can we close this issue?

from famix.

NicolasAnquetil avatar NicolasAnquetil commented on July 17, 2024

No, I think it is still on the table:
by relation query you mean FamixQueries (I hate this name), the model behind the MiQueryBrowser?

If so, then the problem is solved for the MiQueryBrowser, but not for the MooseQueries, the API used by programmers.
And we still need this API because we cannot do everything with the queryBrowser.

Any opinion on introducing a new dependency marker in the builder to mark relationships that introduce dependencies (see comment #121 (comment))?

from famix.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.