Github user sjcorbett commented on the pull request:
https://github.com/apache/incubator-brooklyn/pull/1020#issuecomment-157416626
+1 to not writing this directly into Brooklyn's entities.
Our goal should be for brooklyn-tosca to work against any old Brooklyn and
to handle entities that haven't been written yet. For that reason I do not
favour redefining blueprints items in brooklyn-tosca.
I'd like to see the information that's contained in this PR's `@Tosca`
annotation be computed automatically by whatever is ingesting it in
brooklyn-tosca. We can do this by inspecting the interfaces each entity
implements. Taking the example of the MySQL node in this PR:
```
@Tosca(derivedFrom = "brooklyn.nodes.Database", capabilities = {
@Tosca.Capability(id = "database_endpoint", type =
"tosca.capabilities.Endpoint.Database")
})
```
Both `derivedFrom` and the capability can be inferred by the fact that
`MySqlNode` implements `HasDatastoreUrl`.
@tbouron @nakomis I believe you have some thoughts in this direction.
I haven't settled on a way of doing the same thing with requirements just
yet. I'm not convinced by the addition to the Tomcat8 interface in this PR:
```
@Tosca(requirements = {
@Tosca.Requirement(id = "database_endpoint", capabilityType =
"tosca.capabilities.Endpoint.Database", relationshipType =
"brooklyn.relationships.Configure", upperBound = 1)
})
```
I lean towards either inspecting the types of an entity's config keys or
just leaving requirements to the writer of the Tosca topologies.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---