unicesi / amelia

:airplane: DSL for deploying distributed systems, with custom commands to compile and execute FraSCAti applications
GNU Lesser General Public License v3.0
2 stars 3 forks source link

Allow to add several instances of a subsystem in a deployment specification #31

Closed jachinte closed 8 years ago

jachinte commented 8 years ago

Parameterized subsystems are made to be reusable, this means one should be able to instantiate the same subsystem several times for the same deployment. That is, one should not only set a subsystem instance, but also add many of them.

To consider: should the set method be replaced by an add method? the associated semantics regarding subsystems with parameters should be maintained: if a subsystem has parameters, an instance with no parameters should be used. If an instance with arguments is added, the first one should not be used.

Example:

for (i : 1..4) { // 4 instances of the Sub subsystem
    // (elements within Sub should be deployed 4 times)
    add(new com.company.Sub("node" + i, "another-param"))
}
start(true)
jachinte commented 8 years ago

NOTICE: with this change, subsystem instances must be added explicitely in order to include a subsystem in the deployment. This means that instances with empty constructor are no longer added automatically.