Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 254698 - Allows CDOType to convert value (e.g.: AdjustReference)
Summary: Allows CDOType to convert value (e.g.: AdjustReference)
Status: CLOSED FIXED
Alias: None
Product: EMF
Classification: Modeling
Component: cdo.core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: M6   Edit
Assignee: Simon Mc Duff CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 268663
Blocks: 269793
  Show dependency tree
 
Reported: 2008-11-09 14:52 EST by Simon Mc Duff CLA
Modified: 2010-06-29 09:22 EDT (History)
1 user (show)

See Also:
stepper: galileo+
stepper: review+


Attachments
Patch v1 (8.91 KB, patch)
2009-03-29 16:40 EDT, Simon Mc Duff CLA
no flags Details | Diff
Patch v2 (10.29 KB, patch)
2009-03-29 23:10 EDT, Eike Stepper CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Mc Duff CLA 2008-11-09 14:52:14 EST
> > 2) What do you think, should we refactor the whole type conversion (not only for
> > references) into CDOType? Maybe CDOType could extend CDOValueConverter or so.
> > Then we don't need so many if blocks all over the code. We'd generally call a
> > converter method of the feature type when EObject <--> CDORevision assignment is
> > done. If we do this flexible enough we could even be able to support extensible
> > conversions in the future (for custom EDataTypes).
> Good idea! 
> Should it be called CDOReferenceAdjustable instead of  CDOValueConverter ?
> since it is to adjust references only. (even if it could be Attributes)

I like CDOValueConverter ;-)

Eike
Comment 1 Simon Mc Duff CLA 2008-11-09 16:16:01 EST
I know why you wanted to have CDOValueConverter. I misunderstood you.

I thought you wanted use CDOValueConverter from CDOType instead of CDOAdjustReference. Now, I understand that you would like to get rid of if condition in CDOStore. Right ?

Meanwhile I added adjustReferences in CDOType!! :-) My code is cleaner as well!
Comment 2 Eike Stepper CLA 2008-11-10 02:12:26 EST
> Now, I understand that you would like to get rid of if condition in CDOStore. 
> Right ?

Right ;-)
Comment 3 Simon Mc Duff CLA 2009-03-29 16:40:01 EDT
Created attachment 130190 [details]
Patch v1

IMPORTANT READ BEFORE REVIEW:
I attached that patch to this bugs instead of the rework CDOType since I didn't do that much. We will leave the others stuff for later depends of the requirements.

- Kept CDOType
- Introduction of convertToEMF convertTOCDO <- They are aware of the EClassifier
writevalue and readvalue are not. 

it is why EEnum are kept as integer inside the CDORevision.. because they do not have context of the EClassifier.
- writeValue and readvalue are there to Serialize data
- convertToEMF / convertToCDO context aware.

If we make writeValue and readValue context aware... I think we will not need convertToEMF and convertToCDO anymore. But it will not be possible to serialize data anymore like the query does it.

if you still prefer to have the Enum value inside the revision... do not review that patch... I will make the changes.
Comment 4 Eike Stepper CLA 2009-03-29 23:10:40 EDT
Created attachment 130196 [details]
Patch v2

Ready to be committed.
Comment 5 Simon Mc Duff CLA 2009-03-30 20:27:28 EDT
COmmitted to HEAD
Comment 6 Eike Stepper CLA 2009-04-02 17:35:13 EDT
Fix available in EMF CDO 2.0.0M6b
Comment 7 Eike Stepper CLA 2009-06-27 11:53:48 EDT
Generally available.