| Summary: | Add delegate for EDataType, so you can create from and convert to String using a scripting language | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Modeling] EMF | Reporter: | Hallvard Traetteberg <hal> | ||||||
| Component: | Core | Assignee: | Ed Merks <Ed.Merks> | ||||||
| Status: | CLOSED FIXED | QA Contact: | |||||||
| Severity: | enhancement | ||||||||
| Priority: | P3 | CC: | ed | ||||||
| Version: | unspecified | Flags: | Ed.Merks:
iplog+
|
||||||
| Target Milestone: | --- | ||||||||
| Hardware: | All | ||||||||
| OS: | All | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
Hallvard Traetteberg
No attachment! Created attachment 196911 [details]
An experimental implementation.
The attachment is a ZIP not a patch, so no EMF code is changed and no plugin extensions occur so how can anything change? (In reply to comment #3) > The attachment is a ZIP not a patch, so no EMF code is changed and no plugin > extensions occur so how can anything change? As I wrote initially, I haven't created a patch, but an implementation that can be used "on top of" EMF. If you register an EDataTypeDelegate.Factory implementation and use the provided EFactorySupporting... for your EPackage, it will use your delegate. The code should illustrate the design and be possible to review before creating a real patch (a bit more work). In a proper integration, the code in EFactorySupporting... should be moved to EFactoryImpl, the code in EcoreUtilSupporting... should be moved to EcoreUtil, the rest put in the appropriate package and the extension point with code for populating the registry for the delegate must be written. I can do all this, but first I thought I'd gather comments in the design. It's doesn't help that the zip isn't an exported project... It definitely looks like generally the right approach (modeled after the other types of delegates). I'd be a bit concerned about overhead for delegate testing affecting performance of cases where it's not being exploited. I suspect that could be mitigated by exploiting the fact that the factory knows its package and all the data types passed in should be from that package so that a cheaper guard could be implemented. In fact, we should probably be defining some type of Internal interface for EDataType so that this stuff can be very efficiently cached. I'm definitely interested in pursuing this for the coming release cycle. Created attachment 198824 [details] Patch for EDataType delegate implementation Here's a patch for the implementation against org.eclipse.emf.core checked out using the psf specified in http://wiki.eclipse.org/EMF/Getting_Source#Using_Team_Project_Set_File_.28.psf.29 In addition to the core implementation, I've added the extension point, schema and extension point reader and updated plugin.properties. This part has been based on the EOperation Invocation delegate implementation, and I hope no references to it remain. I've tested the implementation using a delegate for JS4EMF. Note that to implement support for data type conversion in Xcore, I've taken your patch and made a bunch of changes. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=354245 Derivative changes have been committed to CVS for 2.8. The changes are available in builds. |