OCL 2.1 RTF Avatar
  1. OMG Issue

OCL21 — allInstances

  • Key: OCL21-263
  • Legacy Issue Number: 8917
  • Status: closed  
  • Source: David Frankel Consulting ( David Frankel)
  • 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.

  • Reported: OCL 2.0 — Tue, 12 Jul 2005 04:00 GMT
  • Disposition: Resolved — OCL 2.1
  • Disposition Summary:

    No Data Available

  • Updated: Fri, 6 Mar 2015 20:58 GMT