Purpose of registering EPackageConfiguration #105
-
Hi, I'm currently researching how the model server works and trying to implement my own model server for my custom Ecore models. From the examples I see that the model server module is enhanced to provide a specific EPackage configuration that points to the Ecore model is intended to be used. What's the purpose of that? Is it for model validation purposes (i.e. to prevent setting an integer to a string field)? How about a model server that manages several Ecore models? Many thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi, I believe the goal is mostly to initialize the EPackage, to avoid doing it lazily at runtime (Which, in a multi-threaded environment, might not go well). In some previous versions, we were also initializing the EPackage: mapping file extension to Resource Factory, things like that. But this is only necessary when using the EPackage in a standalone Java Application (Using a java In any case, the goal is the same: make sure the EMF environment is properly started/configured/initialized before accepting client connections. So, if you have multiple EPackages, simply make sure to load them and configure them in a similar way. |
Beta Was this translation helpful? Give feedback.
Hi,
I believe the goal is mostly to initialize the EPackage, to avoid doing it lazily at runtime (Which, in a multi-threaded environment, might not go well).
In some previous versions, we were also initializing the EPackage: mapping file extension to Resource Factory, things like that. But this is only necessary when using the EPackage in a standalone Java Application (Using a java
main()
method), as opposed to an Eclipse IApplication (UsingIApplication.start()
). It depends on the use case, but recently I think we're using mostly the latter.In any case, the goal is the same: make sure the EMF environment is properly started/configured/initialized before accepting client connections. So,…