EMF Model Memo

  • EMF - Eclipse Model Framework, that can help you modeling your data model and creating Java code from it.
  • EMF has a meta-model which includes two models: Ecore and Genmodel, Ecore metamodel contains the information about the defined classes, the Genmodel contains additional information for codegeneration.
  • The default uses XMI to persists the model definition, you can also use Java annotations, UML or XML schema.
  • You can use EMF tools to generate EMF meta-model based on diagrams.
  • Based on two file .ecore and .genmodel, you can generate Java code. The generated code will consists of the following:

                 1. model -- Interfaces and Factory to create the Java classes, like Factory.createClassA();

                 2. model.impl -- Implementation of the interfaces defined in model

                 3. model.util -- The AdapterFactory

  • All methods generated are tagged with @generated, if you want to prevent the method is overwritten next generation, you have to remove this flag.


你可能感兴趣的:(Model,emf)