Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make XMICodec better reusable #143

Open
eneufeld opened this issue Nov 29, 2021 · 1 comment
Open

Make XMICodec better reusable #143

eneufeld opened this issue Nov 29, 2021 · 1 comment
Labels
enhancement New feature or request modelserver EMF.cloud Model Server

Comments

@eneufeld
Copy link
Contributor

eneufeld commented Nov 29, 2021

So I stumbled over the point, that whenever we use the modelserver with a new emf model, we basically need to create an own ModelServerClient subclass as well as a XMICodec subclass see: https://github.com/eclipse-emfcloud/coffee-editor/blob/glsp-update/backend/plugins/org.eclipse.emfcloud.coffee.modelserver/src/org/eclipse/emfcloud/coffee/modelserver/CoffeeModelServerClient.java#L63 and https://github.com/eclipse-emfcloud/coffee-editor/blob/7f42783e0dcf290696db75ad8e94dbac965c5114/backend/plugins/org.eclipse.emfcloud.coffee.modelserver/src/org/eclipse/emfcloud/coffee/modelserver/CoffeeCodec.java#L23

The XMICodec could be adapted to actually handle all cases where we use the default EMF serialization without problems (by using the emf model registry).
The main issue right now is, that the Codec interface does not accept a format parameter in encode and decode.
I thus suggest to change the Codec interface to include the format parameter, thus allowing us to have one XMICodec which can handle all EMF resources correctly. Furthermore many clients would not need to extend the MOdelServerClient anymore.

What do you think?

@martin-fleck-at martin-fleck-at added the enhancement New feature or request label Nov 30, 2021
@ndoschek ndoschek added the modelserver EMF.cloud Model Server label Feb 3, 2022
@MichelSc
Copy link

Same observation for JsonCodec V1 and V2: I want to get the calculated fields in the returned json.

Derived fields are filtered out by https://github.com/emfjson/emfjson-jackson/blob/e59f92355ec03eeb82bb2c0a2815006ee85bb353/src/main/java/org/emfjson/jackson/databind/property/EObjectPropertyMap.java#L158

So I need a new codec. For this, I must implement:

  1. a new EObjectPropertyMap (270 lines)
  2. a new EMFSerializer (120 lines)
  3. a new EFMDeserializer (120 lines)
  4. a new CodecProvider
  5. a new JsonCodec
  6. a new EMFModule

All this work just for modifying just one little condition (deep in the code indeed).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request modelserver EMF.cloud Model Server
Projects
None yet
Development

No branches or pull requests

4 participants