eclipse-ocl / org.eclipse.ocl

Eclipse Public License 2.0
0 stars 0 forks source link

[codegen] Use unboxed Collection values #969

Open eclipse-ocl-bot opened 2 months ago

eclipse-ocl-bot commented 2 months ago

| --- | --- | | Bugzilla Link | 389120 | | Status | NEW | | Importance | P3 normal | | Reported | Sep 09, 2012 07:00 EDT | | Modified | Sep 12, 2012 03:07 EDT | | Reporter | Ed Willink |

Description

Collection values currently contains a Value per element.

This is costly for objects\ a) an ObjectValue per element is created\ b) an additional collection (e.g. a Set) is populated

The polymorphic benefits are rarely enough to compensate since collections are often used for size, object identity, object navigation all of which either only need an object count or unbox again to navigate.

eclipse-ocl-bot commented 2 months ago

By Ed Willink on Sep 12, 2012 03:07

Rather than having special collections and lazy boxing, it is easier to take a more rational view of why it is necessary to use boxed values.

Boxing is needed wherever the semantics of Java's Object.equals differ from OCL's OclAny::=. The boxing value provides the OCL semantics in the java world.

Therefore