Coder Social home page Coder Social logo

Comments (4)

NicolasAnquetil avatar NicolasAnquetil commented on September 18, 2024

see moosetechnology/Moose#2070

from famix.

NicolasAnquetil avatar NicolasAnquetil commented on September 18, 2024

may be a method like: #applyAssociation:fromSide:toSide:
or withFrom:withTo:
or fromRole:toRole:
...

from famix.

NicolasAnquetil avatar NicolasAnquetil commented on September 18, 2024

Currently to create an association such as Invocation, we must:

  • in #defineClasses
    • create a class #Invoked-name
    • create a class #Invoker-name
    • create a class #Invok-name
  • in #defineHierarchy
    • Invoked class uses TInvocable
    • Invoker class uses TWithInvocations
    • Invok class uses TInvocation

Things happen in two methods (#defineClasses and #defineHierarchy), often lines are separated because the classes have other properties/inheritances, so the information is scattered which does not make clear the creation of a relationship.

Improvement initially wished was to create classes as usual and define the relationship (i.e. uses of traits) in #defineRelations:

apply: TInvocation on: Invok-class withFrom: Invoker-class withTo: Invoked-class

But we don't have identification of from/to slots in TInvocation so we cannot compute the trait needed by the from/to sides.

from famix.

NicolasAnquetil avatar NicolasAnquetil commented on September 18, 2024

Two possible solutions:

  • creating the classe in #defineClasses + a method with 6 parameters:

applyAssociation: TInvocation on: Invok-class fromSlot: #sender on: Invoker-class toSlot: #candidates on: Invoked-class

(sender is the from slot in TInvocation and candidates is the to slot)

  • small variation: Invok class uses TInvocation (and no other!) in #defineHierarchy:

applyAssociation: Invok-class fromSlot: #sender on: Invoker-class toSlot: #candidates on: Invoked-class

  • Introduce a special notation for association creation so that the to and from slots are explicitly meta-described. There is already FmxMBRelationSide>>source and FmxMBRelationSide>>target which could be some basis for this ...

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.