OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

tosca message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: RE: [tosca] "type" keywords should be conditional, not mandatory


Hi Tal,

 

You are correct about the type keyword being optional in refinements. In fact, in refinements *ALL* keywords must be optional, under the assumption that refinements refine already valid definitions, which already have all the mandatory keywords. The Version 2.0 spec states this in Section 5.1, but we could probably improve on the language to make this even more clear.

 

That said, you chose the one example where this rule doesnât hold, since artifacts are treated differently from most other entities in TOSCA. Artifacts donât have definitions and associated assignments. Instead, they are just directly associated with (or attached to) either a node type or on a node template. If a derived type defines an artifact with the same name as an artifact on a base type, then that artifact just replaces (or overrides) the artifact in the base type. It doesnât refine it, it just redefines it. This is spelled out in Section 5.3.7.2.3 of the Version 2 specification.

 

Chris

 

From: tosca@lists.oasis-open.org <tosca@lists.oasis-open.org> On Behalf Of Tal Liron
Sent: Thursday, February 3, 2022 9:50 AM
To: tosca@lists.oasis-open.org
Subject: [tosca] "type" keywords should be conditional, not mandatory

 

I think we've discussed this briefly in the past, I just want to make sure it's on our TODO so that the whole spec is consistent.

 

The issue is this -- up to TOSCA 1.3 we've marked "type" keywords as mandatory. For example, look at TOSCA 1.3 artifact definition (3.6.7.1). You'll see something similar for "type" keywords in almost all other entities.

 

But in TOSCA 2.0 we've acknowledged that some keywords are "conditional". That is, they would only be mandatory if certain conditions hold. In the case of "type", I think the condition would be "if the type can't be otherwise calculated", and I think that follows with pretty much all the "type" keywords in TOSCA, because often they can be calculated.

 

Let's look specifically at the artifact definition:

 

1) Let's say it's called "banner" and attached to a node type named WebServer. That node type is derived from Application. Application does not have an artifact named "banner". That means this is the first occurrence in the type hierarchy of this artifact. For that reason, we absolutely need to specify "type".

 

2) Let's say that Application does have an artifact named "banner". In this case, we are refining (through inheritance) the definition. The artifact "type" in WebServer, if unrefined, should be the same as the artifact type in Application. So, I would say that it should be unnecessary to specify it. (It's not an error to specify it. Of course, refinement rules mean that it can only be the same artifact type or a type derived from it.)

 

3) Now let's say we have a node template named "frontend" of type WebServer, and we attach an artifact named "banner". This is considered a refinement of "banner" in the WebServer node type. So, again, it should not be mandatory (and have the same refinement rules as #2).

 

4) We're also allowed to attach ad hoc artifacts to node templates (that are not declared at the node type). So let's say we attach an artifact named "footer". The "type" should be mandatory here because it has not been declared anywhere else. As a rule, all ad hoc artifacts need "type".

 



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]