Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 339784 - [language] Introduce a FlattenedCollection type behavior
Summary: [language] Introduce a FlattenedCollection type behavior
Status: NEW
Alias: None
Product: OCL
Classification: Modeling
Component: Core (show other bugs)
Version: 3.1.0   Edit
Hardware: PC Windows Vista
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: OCL Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-12 06:15 EST by Ed Willink CLA
Modified: 2011-03-12 06:15 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Willink CLA 2011-03-12 06:15:00 EST
The Collection(T).collect() iteration is currently unmodelable because many different input types yield the same output type.

Suggest intoduce a FlattenedCollection mix-in analoguous to the OrderedCollection mix-in. This would allow the declaration:

Collection(T).collect() : FlattenedCollection(T)

Application to Set(Sequence(Integer)) invokes the specialization

Bag(Set(Sequence(Integer))).collect() : FlattenedBag(Set(Sequence(Integer))) 

for which built-in type conformance determines that 

FlattenedBag(Set(Sequence(Integer))) conforms to FlattenedBag(Integer) which conforms to Bag(Integer).

The modeling problem on the iteration is therefore moved sideways to a built-in conformance on a special type; a special-behavior type rather than an irregular iteration.