Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Texo/Texo and EMF

Introduction

Texo is targeted at server-side technology (such as web-server and web-service environments). EMF code generation is more targeted for (or originates from) usage in Eclipse RCP products. This difference is focus and origin results in differences also in the implementation and delivered functionality.

Texo makes use of EMF and supports similar concepts as EMF when it makes sense for server-oriented environments. This is mainly in supporting the model at runtime and for XML serialization. In other areas Texo follows a strict java-only pojo approach and eliminates/prevents any direct compile time references from generates pojo's to Texo or EMF classes.

Texo usage of EMF components

Texo uses the following EMF components in its overall solution:

  • Runtime model (EClass, EStructuralFeature, etc.)
  • XSD to Ecore
  • XML serialization

Texo does not make use of the EMF code generation framework. Texo implements its own code generation of entities and pojos.

Differences between EMF and Texo

This different target environments mean that the generated code and functionality. Texo does not (and will not) support or generate code with:
  • EMF list implementations such as bidirectional or containment lists
  • eContainer or containment associations (they are used in the XML serialization supported by Texo but not explicitly expressed in the java code as now in EMF)
  • Notifications and notifiers
  • Adapters
  • Generation of EMF Edit/Editor or other RCP related constructs

This type of functionality is of less use in server environments.

EMF-functionality to be implemented in Texo

Although some EMF functionality is explicitly not supported there are is also EMF functionality which is currently not supported but which is planned to be supported:

  • The unsettable concept of EMF: is used in XML serialization to determine if an element is present in the XML or not
  • [Other topics to be added]

EMF to Texo mapping

Texo has similarities with EMF and some EMF concepts are re-implemented in Texo, sometimes in a different way.

For runtime model support Texo generates and uses the following classes, they can be quite easily mapped to EMF runtime concepts. All the classes can be found in the org.eclipse.emf.texo plugin:

  • ModelPackage: is the equivalent of an EPackage. It takes care of runtime model initialization, provides access to the EPackage, etc. Each EPackage in an ecore model will have an equivalent generated ModelPackage class (the generated class extends ModelPackage).
  • ModelFactory: corresponds to an EFactory. It defines String conversion methods and factory methods for ModelObjects. Each ecore EPackage will have a generated ModelFactory class.
  • ModelObject: the equivalent of the EMF EObject interface. The ModelObject is the interface used by the generated wrappers. For each EClass a wrapper is generated which encapsulates a pojo and gives it a 'Model-face'. The ModelObject provides methods like: eClass, eGet and eSet (see the similarities with EObject).
  • ModelFeatureMapEntry: corresponds to the EMF FeatureMapEntry. This class defines the interface of the generated wrappers for the generated feature map classes. FeatureMaps are used to support flexible XSD construct like the xsd:choice in java. For more information see this [TO ADD FEATUREMAP SUPPORT IN TEXO].

Back to the top