Java API breakage on .ecore change for EMF-related bundles: what is SimRel policy? #748
-
It seems that almost every change in .ecore may break API according to API rules and will require major version increment for "model" bundle that contains generated Java API For example, if we add a transient Another example: we add a Classifier to ecore, and changing (incrementing version) NS URI to distinguish models created with newer version: from API point of view we need major bump for many reasons. One of them is changed value of What is the current policy for this in the scope of SimRel @merks ? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
The API tools are ultra conservative. Add anything to an interface and it's a major version increment. The Platform makes a habit of being careful and suppressing such API errors, e.g., when adding a default method to an interface or a constant to SWT. Of course constants are in-lined so changing that will not be seen by clients who aren't recompiled. The GenModel property `Binary compatible Reflective Methods" can help make derived models binary compatible even if the super class model changes. There is no general policy about this. In my opinion, it's better to simply be pragmatic and try to have as little impact on clients as possible. Major version increments generally cause problems and the more bundles that are downstream from the incremented bundle, the more problems it causes. I've never felt compelled to change the nsURI of a model. It seems to me that that approach generally causes more problems than it prevents. Options like org.eclipse.emf.ecore.xmi.XMLResource.OPTION_RECORD_UNKNOWN_FEATURE are very useful for being able to read a newer model instance with an older implementation and still preserve the unrecognized information. |
Beta Was this translation helpful? Give feedback.
The API tools are ultra conservative. Add anything to an interface and it's a major version increment. The Platform makes a habit of being careful and suppressing such API errors, e.g., when adding a default method to an interface or a constant to SWT.
Of course constants are in-lined so changing that will not be seen by clients who aren't recompiled. The GenModel property `Binary compatible Reflective Methods" can help make derived models binary compatible even if the super class model changes. There is no general policy about this. In my opinion, it's better to simply be pragmatic and try to have as little impact on clients as possible. Major version increments generally cause problems …