Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace generic responses execute block with semantic update blocks #13

Closed
HeikoKlare opened this issue Sep 22, 2016 · 0 comments
Closed
Assignees

Comments

@HeikoKlare
Copy link
Contributor

Currently, a routine in the response language defines an execution block within its effect to define anything that cannot be expressed with statements of the external response DSL.
During runtime, the execute block is executed at a specific point-of-time between the external statements to avoid failures. This is confusing to developers as they do not know which of the statements were already executed before the execute block and which were not.
Furthermore, the execute block is necessary to perform model modification to restore consistency, which are create, update and delete operations on model elements. Since create, retrieve and delete statements are already defined as external statements, only their initialization or update has to be defined in the execute block. Therefore, we can attach a code block to each create statements for the initialization of the element and defined update blocks for the retrieved elements to have to logic attached to the element they belong to.

An example for the difference in the routine definition looks as follows (relying on the modified syntax with curly braces and call blocks from #9, #11 and #12):

Old:

match: {
    retrieve element: retrievedElement ...
    retrieve element: toDeleteElement ...
}
effect: {
    create element: createdElement ... 
    add correspondence between createdElement and retrievedElement
    delete element: toDeleteElement
    execute: {
        createdElement.x =...
        bar.y = ...
    }
call: {
    createSomething(...);
}

New:

match: {
    retrieve element: retrievedElement ...
    retrieve element: toDeleteElement ...
}
effect: {
    create element: createdElement ... and initialize: {
        createdElement.x =...
    }
    add correspondence between createdElement and retrievedElement
    delete element: toDeleteElement
    update bar: {
        bar.y = ...
    }
call: {
    createSomething(...);
}

Although the old version is more concise, it is unclear when the correspondence is created (you could assume it is created before the execute block, but it is not) and the update logic for different models elements is mixed up in the execute block.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant