Issue 8917: allInstances (ocl2-rtf) Source: SAP AG (Mr. David S. Frankel, david.frankel@sap.com) Nature: Uncategorized Issue Severity: Summary: It is not entirely clear from the OCL 2.0 specification whether the allInstances operation returns instances of subclasses of the designated type. In other words, it isn't 100% clear whether t.allInstances( ) returns instances of subclasses of t. Recommendation: The best solution would be to have two operations, one which returns instances of subclasses and one which does not. A second-best solution would be to make it clear that allInstances returns instances of subclasses. In this case, an OCL programmer could use the oclIsTypeOf( ) operation as a filter to write a derived operation that does not return instances of subclasses. If allInstances does not return instances of subclasses, it would not be nearly as straightforward to write a derived operation that does return instances of subclasses. Resolution: Revised Text: Actions taken: July 12, 2005: received issue Discussion: End of Annotations:===== ubject: allInstances Date: Tue, 12 Jul 2005 15:58:09 -0700 Thread-Topic: allInstances Thread-Index: AcWHNSP4spqvEdGhSwSVOuUM0cOBXQ== From: "Frankel, David" To: Cc: , "Uhl, Axel" X-OriginalArrivalTime: 12 Jul 2005 22:58:15.0632 (UTC) FILETIME=[2FE28D00:01C58735] X-SAP: out X-SAP: out Issue: It is not entirely clear from the OCL 2.0 specification whether the allInstances operation returns instances of subclasses of the designated type. In other words, it isn't 100% clear whether t.allInstances( ) returns instances of subclasses of t. Recommendation: The best solution would be to have two operations, one which returns instances of subclasses and one which does not. A second-best solution would be to make it clear that allInstances returns instances of subclasses. In this case, an OCL programmer could use the oclIsTypeOf( ) operation as a filter to write a derived operation that does not return instances of subclasses. If allInstances does not return instances of subclasses, it would not be nearly as straightforward to write a derived operation that does return instances of subclasses.