eclipse-ocl / org.eclipse.ocl

Eclipse Public License 2.0
0 stars 0 forks source link

[library] Create a family of PredefinedOperation classes #433

Closed eclipse-ocl-bot closed 1 month ago

eclipse-ocl-bot commented 1 month ago

| --- | --- | | Bugzilla Link | 289290 | | Status | CLOSED DUPLICATE of bug 196873 | | Importance | P3 normal | | Reported | Sep 13, 2009 03:35 EDT | | Modified | Jun 26, 2010 10:17 EDT | | Version | 1.3.0 | | Reporter | Ed Willink |

Description

Built-in operations such as oclIsNew, were resolved by

a magic constant in PredefinedType\ special treatment in the grammar\ special treatment in the analyzer\ no treatment at all in the validator\ special treatment in the evaluator

This makes for some massive ifs and buts code.

Attachment 146988 to Bug 184048 eliminates the special parsing treatment and slightly simplifies the special anlyzer treatment.

Suggest that each magic constant be replaced by a derived PredefinedOperation class where analyzer, validator and evaluator helper functions can realise the operation-specific semantics. Shared functionality can be provided by AbstractPredefinedOperation.

This should also make it much easier for derived languages to add further PredefinedOperations.

eclipse-ocl-bot commented 1 month ago

By Ed Willink on Jun 26, 2010 10:17

Not exactly a duplicate, but this is the apprfoach that the model-driven library takes.

This bug has been marked as a duplicate of bug 196873