Projet

Général

Profil

Actions

Evolution #379

ouvert

Component inheritance (or extension ?)

Ajouté par Anonyme il y a presque 15 ans. Mis à jour il y a plus de 12 ans.

Statut:
In Progress
Priorité:
Normal
Assigné à:
-
Catégorie:
Architecture & Component Model
Version cible:
-
Début:
10/08/2011
Echéance:
% réalisé:

0%

Temps estimé:

Description

It seems to me that it could be handful to be able to somehow inherit (or extend maybe, not sure of the appropriate term) a speadl component by another.
For example, I defined a kind of template for agents based on Perceive-Decide-Act (PDA), which used a component named CyclicBehavior, providing a port for getting a behaviorCycle (the idea was that ultimatly it could be used for any cyclic behavior, not just PDA).
The problem is that "real" implementations will probably require more ports than the ones specified; and since it is not possible to extend my spec. of Cyclic Behavior, they will need to re-specify it entirely.

Here is my component:

namespace fr.irit.smac.may.lib.components.cyclicBehavior {

    component CyclicBehavior[Ref, BehaviorCycle, Msg] {

        provides behaviorCycle: BehaviorCycle

        requires myRef : Pull[Ref]

        requires getMsg : Pull[Msg]
        requires getMsgs : Pull[List[Msg]]
        requires send : Send[Msg, Ref]

    }
}

(notice how I needed, by design choice, to specify that it needs to communicate by message-passing, with extension mechanisms it would has not be necessary)

I would have liked to be able to extending it for requiring a new port, for example using a syntax like this:

component CyclicBehaviorExtended extends CyclicBehavior{
  provides toto : TOTO
  requires titi : TITI
}

(with my new component "inheriting" the provides, requires and generics from the one it extends of course)

I don't know how well it fits into the underlying theory which MAY is based on, but I think it would be great to be able to do so !

I join the "PDA library" as an illustration (don't mind the package "transverses.messagePassing", it was simply an experiment on my behalf to understand transverse mechanisms).


Fichiers

mycomponents.zip (132 ko) mycomponents.zip Anonyme, 10/08/2011 11:27

Mis à jour par Anonyme il y a plus de 12 ans

  • Catégorie mis à Architecture & Component Model
  • Statut changé de Nouveau à In Progress
  • Assigné à mis à Anonyme

This is partly doable.

For now one can extend a component without parts and can't add any ports in the extending component.
It is enough to have multiple composite realising the same component description to do a bit of genericity, but it's still a bit poor...

Actions

Formats disponibles : Atom PDF