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

Revision as of 13:48, 12 May 2010 by Mtaal.springsite.com (Talk | contribs) (New to-be-documented features)

Introduction

The goal of the Texo project is to provide model and template driven development technology for web application development projects. Texo uses components currently present in the Eclipse Modeling Framework (EMF) and Eclipse Modeling Framework Technology (EMFT) projects. Texo is a proposed open source component in the Eclipse Modeling Framework Technology (EMFT) project.

The original project proposal can be found here.

Benefits of using Texo

Benefits of using current Texo (March 2010):

  • Code Generation:
    • Generates true pojo's from an Ecore model or XSD without direct compile time link from generated entities to EMF, Texo or other framework types. Facilitates integration of EMF concepts with other frameworks such as Google Web Toolkit or Object Relational Mapping solutions
    • Supports manual change of generated code (the same approach as EMF)
    • Overridable and Extendable code generation with support for EMF-like merge, formatting, import-organizing
  • XML support
    • Supports XML Schema constructs (as EMF)
    • XML and XMI Serialization
  • Runtime model support, key to implementing generic functionality as security, archiving, query generation and generic web services.

New functionality which is being developed right now gives these additional benefits:

  • Support for java annotations and annotations defined in the model, to drive code generation and to be translated into java source code annotation
  • Artifact generation can be controlled in detail using model annotations.
  • Multiple annotation models (JPA, Hibernate Search, etc.) supported
  • Easy integration with RIA user interface through a generic model-driven JSON service

Further in the future, Texo will be extended to generate the web user interface layer. This will give additional benefits in terms of increased developer productiviy and quality.


Texo.annotated model runtime.png

Download & Install

Texo is installed through the Eclipse update manager. For more details see the Download & Install page.

Quick Start

The quick start page lets you generate code in just a few steps...

Support

Support is given on the EMFT newsgroup which you can find here:

Texo Components

The initial release of Texo will consist of several components:

  • Code generation for server oriented applications with support for in-model and in-source annotations, manual code changes are supported in the same way as with EMF. Templates can be added/overridden by users.
  • XML Serialization
  • Tool support for creating annotated models
  • JPA annotation generation
  • Model-driven JSON serialization support

Next phase:

  • Add more annotation models (for example: Hibernate Search, jaxb, Seam, EJB3)
  • The next phase will focus on generating User Interface code for GWT or RIA frameworks such as Smartclient or Extjs.
  • Test case/class generation

New to-be-documented features

This section (updated Mid-May 2010) lists features which are available in the latest build but which have not yet been described:

  • The first annotation model (for generating the model code itself) is now ready and used within Texo.
  • Texo now reads an annotationsmodel which is located next to the ecore model to control code generation. This makes it possible to fully control the code generation through a model.
  • Java annotations can be added to the model and will be placed in the generated source code.
  • Texo now generates save api's for many features, meaning that elements are not added to a list/set directly, but through separate addToList/removeFromList methods. The addTo/removeFrom methods take care of bi-directional associations correctly (only a need to set one side of the association).
  • The model classes (ModelPackage/ModelFactory) can be generated in a separate package from the entities.
  • New extension templates have been defined, the entity_addition.xpt, enum_addition.xpt, interface_addition.xpt. These templates are executed within the body of their respective classes and makes it possible to add extra code to the entity/enum/interface class.

If you want more information on these new features ask about them on the newsgroup. Over time the new features are described in more detail in the documentation.

Documentation

The following pages contain detailed information on different parts of the Texo solution:

  • Generate Artifacts: describes how to generate code from one or more xsd/ecore files.
  • Extending/Overriding Code generation: discusses how the Texo templates can be overridden in a development project, while still maintaining the advantages (EMF-like-merge, organize-import, formatting).
  • Runtime Model: describes the runtime model access to Texo generated objects.
  • XML-XMI Serialization: covers the main api to convert Texo generated pojo's from and to XML and XMI.
  • JSON Web Service: describes how the model-driven JSON webservice is implemented and how it can be used by RIA web ui's.
  • EMF Conversion: discusses the Texo-EMF conversion API which make it possible to convert any Texo generated pojo from/to an EObject. This is useful for when you want to make use of other EMF components like EMF Compare.
  • Test data generation: Texo is tested with about 40 models, the test-cases involve conversion from and to EMF, XML and XMI. An important foundation of the test cases is the automatic generation of test data on the basis of the model. This gives a better test coverage and makes it very easy to add new test models to the system and integrate them in the main test runs.

Main Design Concepts

The Texo project is based on a number of main design concepts and philosophies.

  • Annotated Models and Model Annotations: Texo uses annotated models for artifact generation. The goal is to support multiple annotation models (JPA, model oriented, etc.), model annotations can be converted to java annotations or other output. Annotations are set manually and further created by Model Annotators.
  • Runtime model: Texo (just as EMF) supports working with the domain model at runtime. Texo generates Model wrappers to give generated pojo's a Model api.
  • Working with generated artifacts: Texo follows the same philosophy as EMF: generated code can be manually changed, manual changes will be kept/maintained when re-generating the code.

For a more detailed description visit the Design Concepts page.

Texo and EMF

Texo is related to EMF and makes use of specific EMF components. Both Texo and EMF generate java code representing an ecore model in Java. There are however several distinctive differences between the approach chosen and code generation implemented by EMF and Texo. This is covered in detail on this page.

Developing

Developer information (CVS, how to setup a developers environment) can be found on the Developers page.

Current Status

Currently (March 2010) the following has been implemented:

  • pojo generation with runtime model
  • Featuremap support
  • XML/XMI Serialization
  • Template overriding

The next topics::

  • Tooling for manual annotations
  • Model-driven JSON service
  • JPA Annotation Set
  • Generic/Parameterized Types

Other to-be-done topics:

  • make it possible to select output/template folder outside of the project (in the workspace/file system)
  • add formatting for other types of output like xml or property files
  • add support for merging of property files (xml merging is also desirable but very complex)

Back to the top