Projet

Général

Profil

Actions

SpeADL Reference » Historique » Révision 12

« Précédent | Révision 12/34 (diff) | Suivant »
Anonyme, 09/10/2014 10:32


SpeADL Full Reference

DRAFT Document

In SpeADL, a set of abstractions are provided to describe typical component-oriented architectures.
On top of these, SpeADL introduced two additional abstractions that complete the typical component-oriented ones in order to describe dynamic architectures and in particular Multi-Agent Systems.
The motivations behind these abstractions are fully explained in the Ph.D. thesis that led to the creation of MAY, see that page for more information.

The main idea with these abstraction is to permit to define software components, called ecosystems, that are able to dynamically create other software components, called species, and link such components to some of their sub-components in a safe and controlled manner.
For example, one can define a Bank component containing a Database and that creates Account component which themselves requires access to the database.
Or one can define a MAS environment component that creates Agent components (internally architectured as desired)connected through localised interaction mechanisms like an agent-oriented framework would do.

But more interestingly, one can actually implement its own connection between the dynamically created components and the creating component.
This enables for example to cleanly and easily implement any needed interaction mechanism in a MAS when there exists no agent-oriented framework proposing it, or to develop domain-specific relations between the agents and their environment.

SpeADL⁻

It is needed to understand the content of the SpeADL⁻ Reference Guide before reading the current document.

Ecosystem Class Definition

From an external point of view, an ecosystem is exactly similar to a component: it has provided ports that can be accessed and required ports that must be connected.
It has a name, can have type parameters and be a specialisation of another component.
It has an implementation in Java, it can be used as a part of another component (or ecosystem) or instantiated directly if it has no required ports.

Its only specificity is that it can contain what is called species, a special type of component that can only be defined in an ecosystem.
Actually, we can say that a component is an ecosystem without any species.

Species are to ecosystems what non-static inner classes are to classes.

Species are components class that can only be instantiated from within an ecosystem instance.
Because of this particular relation to ecosystem, species can be connected to elements inside the ecosystem in two different ways:
  • Directly to the parts and ports of the ecosystem.
  • Indirectly through a special construct called Uses that enables to take into account the dynamic creation aspects of the species to:
    • Build tailored ecosystem-species relations.
    • Build tailored inter-species relations meditated by the ecosystem.

Keywords

An ecosystem class definition is declared with the keyword ecosystem followed by a name, optional type parameters and optional specialization.
Inside an ecosystem, provided and required ports can be declared as with normal components with the keywords provides and requires.
Inside an ecosystem, parts can be declared as with normal components with the keyword part.

A species is declared inside an ecosystem with the keyword species followed by a name starting with a capital.
It has no type parameters but follows those of its ecosystem, and cannot specialise a component.

Inside a species, provided and required ports can be declared as with normal components with the keywords provides and requires.
Inside a species, parts can be declared as with normal components with the keyword part.

Details

Declaring an ecosystem only enables to declare species in them: if there is no species in it, it is exactly similar to a component.

Declaring a species means that the ecosystem instance that contains it will be able to create new instances of the species at runtime.
Such species will be considered strongly linked to the containing ecosystem instance that created them: this is a thus 1..N relation.

Such a relation can be exploited either:
  • In the implementation of the ecosystem and the species (sharing references to Java objects, calling a port of the ecosystem from the species, etc).
  • At the SpeADL level with the bindings and delegation from the species to the ecosystem.
  • At a higher-level using advanced interconnection mechanisms between ecosystem and their species as explained below (using a message passing mechanism between the dynamically created instances of a species).

The bindings of the parts can point to ports inside the species, as with a normal component, but also to ports inside the ecosystem containing the species.
They can NOT point to other species of the ecosystem (for inter-species connection, one must exploit the use abstraction).

Example

namespace simple.ecos {    
    ecosystem MyFirstEco {

        species S {
            provides p1: AJavaInterface = c.portName
            requires p2: AnotherJavaInterface

            part c: MyBeautifulComponent {
                bind anotherPortName to p2
            }
        }
    }
}

The Use Abstraction

Keywords

Inside a species, a special type of part can be declared using the keyword use followed by a name without capital letter.
It follows the syntax use name: partName.SpeciesName where:
  • partName is the name of a part in the ecosystem containing the current species and whose type is an ecosystem.
  • SpeciesName is the name of a species declared in the ecosystem of partName.

Details

The important point about the use abstraction is that it relies on the definition of ecosystem and species: it is a way to recursively exploit an ecosystem and its species in another ecosystem and its species.
The contained ecosystem and its parts are instantiated with the containing ecosystem, and its species instantiated with the species that use them.

Example

namespace simple.ecos {    
    ecosystem MySecondEco {

        part e: MyFirstEco

        species S {

            part c: MySimpleComponent

            use s: e.S {
                bind p2 to c.p1
            }
        }
    }
}

Mis à jour par Anonyme il y a plus de 11 ans · 34 révisions