-
Notifications
You must be signed in to change notification settings - Fork 21
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
Improve extensibility of model server formats and codecs #60
Comments
In the submitted PR, the Codecs class keeps a backward compatibility, because I am afraid it may be used by Model Server users. The codecs and formats can be easily overridden in ModelServerModule with a map, and also a String for telling the preferred format. (explained in javadoc) The Codecs manager class is now intended to be injected, and its default constructor is now deprecated, only kept for legacy behavior. I, Vincent HEMERY, have the authorization of my employer, CS GROUP, to make this contribution under the appropriate licenses conditions. Note I have updated impacted tests as far as I could tell they needed. There may be additional test updates needed which didn't work before in my environment, but I think I'm missing some information here... |
* Improve extensibility of model server formats and codecs #60 Use Map binding for codecs and format. Also give the possibility to specify a preferred format (json by default). The Model Server Client now has overrideable methods so that it can change the accepteable formats when necessary. Changes review : let user the possibility to override Codecs implementation. Signed-off-by: vhemery <vincent.hemery@csgroup.eu>
Thank you for your change, I merged it and we can consider this issue closed. |
Thank you @martin-fleck-at for your implication and open-minded spirit. |
As reported on Spectrum, the model server does not provide any way to add custom codecs or replace existing ones. The main reason for this is that we have a single
Codecs
class that has the two by-default supported formats (XMI, JSON) hard-coded.The goal of this task it to improve on that situation by allowing the user to register/bind new codecs or replace existing ones.
As a suggestion: Make the codecs configurable with DI:
ModelServerModule
. For this the interface could be enhanced with the extension/format the codec handles and a priority if necessary. It should be easily possible to register multiple codecs. TheDefaultModelServerModule
should at least bind the two default codecs.Codecs
class offers now. The manager is then injected where necessary but might also be overwritten/rebound in a custom module.The text was updated successfully, but these errors were encountered: