Bug 227127 - Support literal values for FeatureInitializers
Summary: Support literal values for FeatureInitializers
Status: RESOLVED FIXED
Alias: None
Product: GMF-Tooling (ARCHIVED)
Classification: Modeling
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 2.2   Edit
Assignee: Artem Tikhomirov CLA
QA Contact:
URL:
Whiteboard:
Keywords: test
Depends on:
Blocks:
 
Reported: 2008-04-15 09:36 EDT by Artem Tikhomirov CLA
Modified: 2010-07-19 22:08 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Artem Tikhomirov CLA 2008-04-15 09:36:07 EDT
It's odd to use e.g. OCL to initialize string attribute with a fixed literal (e.g. MindMap example uses OCL expression "'includes'"). And even ECore's EReference.setContainment(true/false) might benefit from simple boolean literals. For such cases, better approach would be as-is value, or literal, that would get assigned without any further involvement of expressions/evaluators.

Need to add another language to ValueExpression to support literal values, templates should get updated to pass value as is (e.g. false or "includes").

Besides, no extra expressions/factories (AbstractExpression, OCLExpression, OCLFactory) should get generated if no OCL or similar expression is in use.
Comment 1 Artem Tikhomirov CLA 2008-07-02 13:23:16 EDT
ValueExpressions that are used from FeatureSequenceInitializers can be of LITERAL kind now, which effectively injects expression body right into appropriate feature (so that ECore Diagram EReference's initialization looks like 'eRef.setContainment(true)' instead of all the 'OCLFactory.getExpression("true",...).evaluate(eRef)')

GMF Codegen updated to respect actual expression kinds (based on providers present in the model), and doesn't generate AbstractExpression if there are no uses of it.
Note, this is sort of a change people out there might be affected with, if they relied on the class being generated always.

Tests: ElementInitializerTest#testLiteralElementInitializers()
Comment 2 Eclipse Webmaster CLA 2010-07-16 23:35:00 EDT
[target cleanup] 2.2 M1 was the original target milestone for this
bug
Comment 3 Eclipse Webmaster CLA 2010-07-19 22:08:36 EDT
[GMF Restructure] Bug 319140 : product GMF and component
Models - Mapping was the original product and component for this bug