In
http://www.vogella.de/articles/EclipseEMF/article.html
6. Using the model code
6.2. Example
The listing
import de.vogella.emf.webpage.model.webpage.impl.WebpagePackageImpl;
public class UsingEMFModel {
public static void main(String[] args) {
WebpagePackageImpl.init();
would be better with
import de.vogella.emf.webpage.model.webpage.WebpagePackage;
public class UsingEMFModel {
public static void main(String[] args) {
WebpagePackage.eINSTANCE;
or
WebpagePackage.eINSTANCE.eClass();
WebpagePackage.eINSTANCE does nothing else than calling
*.impl.WebpagePackageImpl.init();
But I think it's better, cause it's more about Separation of Concerns.
The Project with the model does not need to (must not) export the
generated *.impl-Package as it's set in the manifest.mf under Export-
Package:.
And the Plugin-Project using the model, shouldn't care about the
implementation. It even needn't to know, about its existence. The
Interfaces are sufficent and are everything to know about for usage.