Issue 13181: ** QVTo Standard Library (qvt-rtf) Source: Open Canarias, SL (Mr. Adolfo Sanchez-Barbudo Herrera, nobody) Nature: Clarification Severity: Minor Summary: ** QVTo Standard Library. Some operation's returned values would better return the TemplateParameterType ** Several stdlib operations would be better changed to avoid doing unnecessary castings on the returned value of the operation. For AnyType::oclAsType(oclType) operation I could write: var aClass : Class := anotherVar.oclAsType(Class); However, for Model::objectsOfType(OclType) operation I can't do: var aClassSet : Set(Class) := aModel.objectsOfType(Class); I have to do the following, instead: var aClassSet : Set(Class) := aModel.objectsOfType(Class).oclAsType(Set(Class)); Therefore, for end-user usability, I propose exploiting TemplateParameterType and changing some QVTo Standard Library operations Element::subobjectsOfType(OclType) : Set(T) Element::allSubobjects(OclType) : Set(T) Element::subobjectsOfKind(OclType) : Set(T) Element::allSubobjectsOfKind(OclType) : Set(T) Element::clone() : T Element::deepclone() : T Model::objectsOfType(OclType) : Set(T) Model::copy() : T Model::createEmptyModel(): T Note: this approach is made in the Object::asOrderedTuple() : OrderedTuple(T) operation. Resolution: 8.3.5.7 createEmptyModel static Model::createEmptyModel() : Model Creates and initializes a model of the given type. This operation is useful when creating intermediate models within a transformation. QVTo Standard Library. Some operation's returned values would better return the TemplateParameterType ** Several stdlib operations would be better changed to avoid doing unnecessary castings on the returned value of the operation. For AnyType::oclAsType(oclType) operation I could write: var aClass : Class := anotherVar.oclAsType(Class); However, for Model::objectsOfType(OclType) operation I can't do: var aClassSet : Set(Class) := aModel.objectsOfType(Class); I have to do the following, instead: var aClassSet : Set(Class) := aModel.objectsOfType(Class).oclAsType(Set(Class)); Therefore, for end-user usability, I propose exploiting TemplateParameterType and changing some QVTo Standard Library operations Element::subobjectsOfType(OclType) : Set(T) Element::allSubobjects(OclType) : Set(T) Element::subobjectsOfKind(OclType) : Set(T) Element::allSubobjectsOfKind(OclType) : Set(T) Element::clone() : T Element::deepclone() : T Model::objectsOfType(OclType) : Set(T) Model::copy() : T Model::createEmptyModel(): T Note: this approach is made in the Object::asOrderedTuple() : OrderedTuple(T) operation. Discussion subobjectsOfType etc duplicate [1]QVT13-53 clone/deepclone merged into [2]QVT13-53 Model::copy/createEmptyModel - NO. Model is the correct return type. ---------------------------------------------------------------------------------------- [1] http://issues.omg.org/browse/QVT13-53 [2] http://issues.omg.org/browse/QVT13-53 Revised Text: Actions taken: December 19, 2008: received issue December 22, 2015: Duplicate or Merged March 29, 2016: closed issue Discussion: This is the approach taken by the OCL Standard Library modeling in Eclipse OCL using the OclSelf type, which has a well-defined meaning whereas TemplateParameterType is magic. A proper QVT Library model should use the modeling capabilities to be provided by OCL 2.5. Disposition: Deferred End of Annotations:===== m: webmaster@omg.org Date: 19 Dec 2008 13:55:07 -0500 To: Subject: Issue/Bug Report -------------------------------------------------------------------------------- Name: Adolfo Sanchez-Barbudo Herrera Company: Open Canarias S.L. mailFrom: adolfosbh@opencanarias.com Notification: Yes Specification: MOF 2.0 QVT Section: 8.3 FormalNumber: formal/2008-04-03 Version: 1.0 RevisionDate: 04/03/08 Page: 104 Nature: Clarification Severity: Minor HTTP User Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; es-ES; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5 Description ** QVTo Standard Library. Some operation's returned values would better return the TemplateParameterType ** Several stdlib operations would be better changed to avoid doing unnecessary castings on the returned value of the operation. While for AnyType::oclAsType(oclType) operation I could write: var aClass : Class := anotherVar.oclAsType(Class); for Model::obectsOfType(OclType) operation I can't do: var aClassSet : Set(Class) := aModel.objectsOfType(Class); I have to do the following instead: var aClassSet : Set(Class) := aModel.objectsOfType(Class).oclAsType(Set(Class)); Therefore, for end-user usability, I propose exploiting TemplateParameterType and changing some QVTo standard Library operations Element::subobjectsOfType(OclType) : Set(T) Element::allSubobjects(OclType) : Set(T) Element::subobjectsOfKind(OclType) : Set(T) Element::allSubobjectsOfKind(OclType) : Set(T) Element::clone() : T Element::deepclone() : T Model::objectsOfType(OclType) : Set(T) Model::copy() : T Model::createEmptyModel(): T Note: this approach is made in the Object::asOrderedTuple() : OrderedTuple(T) operation. same AST as if I write OclVoid or oclAsType. With this idea, I'm really puzzled with the third paragraph of the section. Please revise this section so that it is less confusing.