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

Create a self import keyword in the DSL #875

Open
vincent-zurczak opened this issue Oct 6, 2017 · 0 comments
Open

Create a self import keyword in the DSL #875

vincent-zurczak opened this issue Oct 6, 2017 · 0 comments
Milestone

Comments

@vincent-zurczak
Copy link
Member

Consider the reusable recipe available here. It allows to run a Cassandra cluster from Roboconf.

What is important is...

imports: cassandraNode.* (optional);

Now, let's assume one wants to deploy two Cassandra clusters within the same Roboconf application. Channels would be a solution, but we have not yet implemented them (see #14). Another solution that was introduced for specialization was sub-typing. Which is fine for exports. And for imports. As long as you do not make the graph portion something reusable.

Currently, if we write something like...

cassandraForJames {
    extends: cassandraNode;
}

cassandraForSomethingElse {
    extends: cassandraNode;
}

... no matter what we do, cassandraForJames will be notified every time a cassandraForSomethingElse appears or disappears. And vice-versa. They will see each other because they inherit the...

imports: cassandraNode.* (optional);

... statement.
While we would like the behavior to be « import my exact siblings ». This is why we should introduce the self import statement in our graph. Thus, we would update our reusable recipe for Cassandra with...

imports: SELF.* (optional);

... and cassandraForJames would only see cassandraForJames instances, and cassandraForSomethingElse would only see cassandraForSomethingElse instances. SELF would become a specific key word. That would improve reusable recipes. 😎

@vincent-zurczak vincent-zurczak added this to the 0.10 milestone Oct 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant