Issue 18829: Introduce selectByKind and selectByType operations (ocl2-rtf) Source: Nomos Software (Dr. Edward Willink, ed(at)willink.me.uk) Nature: Clarification Severity: Minor Summary: A very common 'idiom' in OCL expressions is sources->select(oclIsKindOf(T))->collect(oclAsType(T))->asSet() to select the sub-set of type T. This involves four library calls and requires T to be typed twice. In practice sources->select(oclIsKindOf(T)).oclAsType(T) may save one operation call at the expense of the wrong collection type. Suggest introduce sources->selectByKind(T) sources->selectByType(T) to simplify this oclIsKindOf/oclIsTypeOf usage. Resolution: Revised Text: Actions taken: July 21, 2013: received issue Discussion: End of Annotations:===== m: webmaster@omg.org Date: 21 Jul 2013 10:16:02 -0400 To: Subject: Issue/Bug Report ******************************************************************************* Name: Edward Willink Employer: mailFrom: ed@willink.me.uk Terms_Agreement: I agree Specification: OCL Section: 11 FormalNumber: 12-01-01 Version: 2.3.1 Doc_Year: 2012 Doc_Month: January Doc_Day: 01 Page: n/a Title: Introduce selectByKind and selectByType operations Nature: Clarification Severity: Minor CODE: 3TMw8 B1: Report Issue Remote Name: edwillink.plus.com Remote User: HTTP User Agent: Mozilla/5.0 (Windows NT 6.0; rv:22.0) Gecko/20100101 Firefox/22.0 Time: 10:16 AM Description: A very common 'idiom' in OCL expressions is sources->select(oclIsKindOf(T))->collect(oclAsType(T))->asSet() to select the sub-set of type T. This involves four library calls and requires T to be typed twice. In practice sources->select(oclIsKindOf(T)).oclAsType(T) may save one operation call at the expense of the wrong collection type. Suggest introduce sources->selectByKind(T) sources->selectByType(T) to simplify this oclIsKindOf/oclIsTypeOf usage.