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

Difference between revisions of "Texo"

(Introduction)
(Object Store)
 
(109 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
==Introduction==
 
==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 [http://www.eclipse.org/emf Eclipse Modeling Framework (EMF)] and [http://www.eclipse.org/modeling/emft/ Eclipse Modeling Framework Technology (EMFT)] projects. Texo is a proposed open source component in the [http://www.eclipse.org/modeling/emft/ Eclipse Modeling Framework Technology (EMFT)] project.
+
'''Texo''' supports EMF-model concepts in (web)server environments through JPA-annotated code generation and full REST JSON web service functionality at runtime.  
  
The original project proposal can be found [[Texo/Project_Proposal | here]].
+
For the latest news on Texo visit the [http://martintaal.wordpress.com/category/texo/ Texo blog].
 +
 
 +
Texo uses components currently present in the [http://www.eclipse.org/emf Eclipse Modeling Framework (EMF)] and [http://www.eclipse.org/modeling/emft/ Eclipse Modeling Framework Technology (EMFT)] projects.
 +
 
 +
Texo (incubation) is an open source component in the [http://www.eclipse.org/modeling/emft/ Eclipse Modeling Framework Technology (EMFT)] project.
 +
 
 +
 
 +
[[Image:texo-client-server.png|center|600px]]
  
 
== Benefits of using Texo ==
 
== Benefits of using Texo ==
  
Benefits of using current Texo (January 2010):
+
Benefits of using current Texo (November 2012):
 
* Code Generation:
 
* Code Generation:
** Generates '''true pojo's from an Ecore model or XSD''' without direct compile time link 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
+
** [[#Code_generation_topics|Generates]]''' true pojo's from an Ecore/Xcore 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)
 
** 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
+
** '''[[Template_Overriding|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.
+
* Supports '''java annotations''' and '''annotations defined in the model''', to drive code generation and to be translated into java source code annotation
+
  
 +
* Provides a generic CRUD REST and Query web service layer for all your models, [[JSON_REST_Web_Services|JSON]] as well as [[XML_REST_Web_Services|XML]]
  
New functionality which is being developed right now gives these additional benefits:
+
* '''[[#ORM.2FJPA_generation_topics|ORM/JPA generation]]''', Texo generates JPA annotations in the source code or can generate the orm.xml mapping from the ecore/xcore models, there are specific JPA model annotations which can be used to control JPA/ORM generation.
* '''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.
+
* Supports most '''XML Schema constructs''' (as EMF)
  
 +
* '''[[#Runtime_topics|Runtime support]]''': model@runtime, key to implementing generic functionality as security, archiving, query generation and generic web services.
  
[[Image:texo.annotated_model_runtime.png|center|650px]]
+
* [[Direct_Java_Annotations|Support]] for '''java annotations''' and '''annotations defined in the model''', to drive code generation and to be translated into java source code annotation
  
 
== Download & Install ==
 
== Download & Install ==
Line 36: Line 37:
 
The [[Texo/QuickStart|quick start]] page lets you generate code in just a few steps...
 
The [[Texo/QuickStart|quick start]] page lets you generate code in just a few steps...
  
== Texo Components ==
+
== Documentation ==
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:
+
The following pages contain detailed information on different parts of the Texo solution.  
* 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 [http://www.smartclient.com Smartclient] or [http://www.extjs.com Extjs].
+
* Test case/class generation
+
  
== Documentation ==
+
=== Blog ===
 +
For general announcement and other information visit the [http://martintaal.wordpress.com/category/texo/ Texo Blog].
  
The following pages contain detailed information on different parts of the Texo solution:
+
=== Code generation topics ===
* [[Texo/Generate_Artifacts|Generate Artifacts]]: describes how to generate code from one or more xsd/ecore files.
+
* [[Texo/Generate_Artifacts|Code Generation Introduction]]: describes how to generate code from one or more xsd/ecore/xcore files.
* [[Texo/Template_Overriding|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).
+
* [[Texo/Code_Generation_Details|Code Generation Details]]: describes how the code generation can be controlled in detail by annotating the model.
 +
* [[Texo/Automatic_Code_Generation|Automatic Code Generation]]: code can be generated automatically when a model file is changed.
 +
* [[Texo/Integrate code generation in a build|Generate code as part of a build]]: discusses how you can integrate Texo artifact generation within your automated build process.
 +
* [[Texo/Code_Generation_Patterns|Code Generation Patterns]]: discusses several common code generation patterns which are supported by Texo (as a default or through setting annotations).
 +
* [[Texo/Template_Overriding|Extending/Overriding Code generation]]: discusses how the Texo templates can be overridden in a development project, while still maintaining the advantages of using Texo (EMF-like-merge, organize-import, formatting).
 +
* [[Texo/Direct_Java_Annotations|Java annotations from model-to-code]]: Texo can transfer java annotations defined in the model into the generated code.
 +
 
 +
=== ORM/JPA generation topics ===
 +
* [[Texo/Generate_JPA-ORM_Introduction|ORM/JPA Generation Introduction]]: introduces the ORM generation implemented by Texo.
 +
* [[Texo/ORM_JPA_Options|ORM/JPA Generation Options]]: you can set generation options at development project level.
 +
* [[Texo/ORM_JPA_Annotations_Details|ORM/JPA Annotations Model]]: for even more control on ORM/JPA generation, the model can be annotated with ORM/JPA annotations.
 +
 
 +
=== Runtime topics ===
 +
 
 +
==== JPA/Persistence integration ====
 +
* [[Texo/EntityManagerHandling|EntityManager]]: describes how Texo generated code and Texo framework code integrates with the EntityManagerFactory.
 +
* [[Texo/Dao|DAO support, Texo generated Dao classes]]: Texo is capable of generating Dao classes which make it easier to query and access objects in the database, in addition the generated Dao classes support cross referencing functionality.
 +
 
 +
==== XML/JSON REST Web Service Support ====
 +
* [[Texo/JSON_REST_Web_Services|JSON REST Web Services]]
 +
* [[Texo/XML_REST_Web_Services|XML REST Web Services]]
 +
 
 +
==== Object Store Implementations ====
 +
The Texo web runtime layer uses the object store concept to store and retrieve data. Texo offers different object store implementations:
 +
* [[Texo/EntityManagerObjectStore|Entity Manager Object Store]]: the entity manager object store integrates the Texo model layer with the JPA layer. You can query the database using EClasses and do cross-reference checks.
 +
* [[Texo/EMFResourceObjectStore|EMF Resource Object Store]]: the EMF resource object store uses EMF resources to persist its data.
 +
 
 +
==== Framework ====
 +
* [[Texo/Components|Components]]: discusses how you can replace internal Texo components with your own implementation to override specific Texo behavior.
 
* [[Texo/Runtime_Model|Runtime Model]]: describes the runtime model access to Texo generated objects.
 
* [[Texo/Runtime_Model|Runtime Model]]: describes the runtime model access to Texo generated objects.
 +
 +
==== RCP Persistence using EMF Resources and Texo ====
 +
* [[Texo/EMFResource|Texo EMF Resource]]: describes the implementation of Texo EMF resources allowing you to persist data from your RCP in a 2- and 3-tier architecture.
 +
 +
==== EMF/XML/XMI ====
 
* [[Texo/XML and XMI Serialization|XML-XMI Serialization]]: covers the main api to convert Texo generated pojo's from and to XML and XMI.  
 
* [[Texo/XML and XMI Serialization|XML-XMI Serialization]]: covers the main api to convert Texo generated pojo's from and to XML and XMI.  
* [[Texo/JSON|JSON Web Service]]: describes how the model-driven JSON webservice is implemented and how it can be used by RIA web ui's.
 
 
* [[Texo/Convert to EMF|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.
 
* [[Texo/Convert to EMF|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.
* [[Texo/Test_Data_Generation|Test data generation]]: Texo is tested with about 20 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.
+
* [[Texo/Xcore Support|Xcore Support]]: Texo supports xcore in the same way as standard ecore and xsd files. You can generate JPA annotated code, orm.xml etc. directly from an xcore file.
 +
 
 +
==== Miscellaneous ====
 +
* [[Texo/Test_Data_Generation|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 ==
 
== Main Design Concepts ==
Line 72: Line 100:
  
 
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 [[Texo/Texo_and_EMF|this page]].
 
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 [[Texo/Texo_and_EMF|this page]].
 +
 +
== Support & Troubleshooting & Bugzilla ==
 +
 +
For troubleshooting and issues encountered by other users see the [[Texo/Troubleshooting|trouble shooting]] page.
 +
 +
To enter a new bugzilla you can use the following link:
 +
 +
https://bugs.eclipse.org/bugs/enter_bug.cgi?product=EMFT&component=Texo&version=0.9.0
 +
 +
Support is given on the EMFT newsgroup which you can find here:
 +
* nntp: news://news.eclipse.org/eclipse.technology.emft
 +
* forum: http://www.eclipse.org/forums/eclipse.technology.emft
 +
 +
== Backward Compatibility ==
 +
 +
Starting from the 0.9.0 version backward compatibility related topics will be published in this section.
 +
 +
=== 0.9.0 - Version 28 December 2014 ===
 +
 +
* This issue [https://bugs.eclipse.org/bugs/show_bug.cgi?id=420913 420913] is resolved. There is a property of the EPackage or EReference generation annotation which controls if [https://wiki.eclipse.org/Texo/Code_Generation_Patterns#Generation_of_a_safe_bi-directional_association_API_.28or_not.29 bi-directional association] support is generated in the java code. This was not working correctly, in that to get this to be working also the 'Generate save many access' on the EPackage gen annotation should be set to true. This was not correct in, also without setting this additional property, bi-directional access should be generated correctly. This is now resolved. Note bi-directional access is (and was) 'true'/enabled by default. This can mean that newly generated code (previously generated by a previous Texo version) will change as now the bi-directional property is correctly considered. To keep the old behavior, create an annotation model which sets generateBidirectionalAssociationSupport to false (see [http://git.eclipse.org/c/texo/org.eclipse.emf.texo.git/tree/tests/org.eclipse.emf.texo.modelgenerator.test/models/samples/extlibrary.annotationsmodel here] for an example, only the generateBidirectionalAssociationSupport part is relevant for this bullet).
 +
 +
* The createModelObject method of the ModelFactory has been [http://git.eclipse.org/c/texo/org.eclipse.emf.texo.git/commit/core/org.eclipse.emf.texo/src/org/eclipse/emf/texo/model/ModelFactory.java?id=31fb5c7415651646109f711634d0895053ecb0d0 changed] to return a parameterized ModelObject (ModelObject<T>) instead of earlier the ModelObject<?>. With this it is not needed anymore to cast the returned value from createModelObject.
  
 
== Developing ==
 
== Developing ==
  
Developer information (CVS, how to setup a developers environment) can be found on the [[Texo/Developing|Developers]] page.
+
Developer information (GIT, how to setup a developers environment) can be found on the [[Texo/Developing|Developers]] page.
 +
 
 +
== Future Topics ==
 +
 
 +
This is a list of future topics which we may (or may not) work on in the future, it is a list of ideas:
 +
* Runtime Layer
 +
** Backend Store: nosql database, elasticsearch
 +
** WebService Support: odata integration
 +
** Integrated with EMF Client Platform
 +
** Introduce service oriented architecture concepts, focusing on micro-service architectures
 +
** integrate with OLAP/Mondrian solutions, back-end and front-end
 +
** develop a generic (and extendable) mobile/html5 model editor which can/should support most models out of the box
 +
** support code generation which generates separate source files which can be manually changed, so not following the @generated pattern used in standard EMF
 +
** use this generic model editor as a basis for a generated model editor in html5/mobile
 +
** integrate with full text indexing and search for the JSON/XML web service layer, incorporate this in the generic model editor
 +
* Code/Artifact Generation:
 +
** Support JPA 2.1
 +
** Support Ecore/XCore generic types
 +
** Support Ecore/XCore operations
 +
** Add JPA/Texo annotation support in Xcore
 +
 
 +
Feel free to react on the EMFT newsgroup with more ideas.
  
== Current Status ==
+
== See also ==
  
Currently (March 2010) the following has been implemented:
+
* [[Teneo]]
* pojo generation with runtime model
+
* [[CDO]]
* Featuremap support
+
* XML/XMI Serialization
+
* Template overriding
+
  
The next topics::
+
[[Category:EMFT]] [[Category:EMF]] [[Category:Texo]]
* Tooling for manual annotations
+
* Model-driven JSON service
+
* JPA Annotation Set
+
* Generic/Parameterized Types
+

Latest revision as of 09:13, 8 December 2015

Introduction

Texo supports EMF-model concepts in (web)server environments through JPA-annotated code generation and full REST JSON web service functionality at runtime.

For the latest news on Texo visit the Texo blog.

Texo uses components currently present in the Eclipse Modeling Framework (EMF) and Eclipse Modeling Framework Technology (EMFT) projects.

Texo (incubation) is an open source component in the Eclipse Modeling Framework Technology (EMFT) project.


Texo-client-server.png

Benefits of using Texo

Benefits of using current Texo (November 2012):

  • Code Generation:
    • Generates true pojo's from an Ecore/Xcore 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
  • Provides a generic CRUD REST and Query web service layer for all your models, JSON as well as XML
  • ORM/JPA generation, Texo generates JPA annotations in the source code or can generate the orm.xml mapping from the ecore/xcore models, there are specific JPA model annotations which can be used to control JPA/ORM generation.
  • Supports most XML Schema constructs (as EMF)
  • Runtime support: model@runtime, key to implementing generic functionality as security, archiving, query generation and generic web services.
  • Support for java annotations and annotations defined in the model, to drive code generation and to be translated into java source code annotation

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...

Documentation

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

Blog

For general announcement and other information visit the Texo Blog.

Code generation topics

ORM/JPA generation topics

Runtime topics

JPA/Persistence integration

  • EntityManager: describes how Texo generated code and Texo framework code integrates with the EntityManagerFactory.
  • DAO support, Texo generated Dao classes: Texo is capable of generating Dao classes which make it easier to query and access objects in the database, in addition the generated Dao classes support cross referencing functionality.

XML/JSON REST Web Service Support

Object Store Implementations

The Texo web runtime layer uses the object store concept to store and retrieve data. Texo offers different object store implementations:

  • Entity Manager Object Store: the entity manager object store integrates the Texo model layer with the JPA layer. You can query the database using EClasses and do cross-reference checks.
  • EMF Resource Object Store: the EMF resource object store uses EMF resources to persist its data.

Framework

  • Components: discusses how you can replace internal Texo components with your own implementation to override specific Texo behavior.
  • Runtime Model: describes the runtime model access to Texo generated objects.

RCP Persistence using EMF Resources and Texo

  • Texo EMF Resource: describes the implementation of Texo EMF resources allowing you to persist data from your RCP in a 2- and 3-tier architecture.

EMF/XML/XMI

  • XML-XMI Serialization: covers the main api to convert Texo generated pojo's from and to XML and XMI.
  • 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.
  • Xcore Support: Texo supports xcore in the same way as standard ecore and xsd files. You can generate JPA annotated code, orm.xml etc. directly from an xcore file.

Miscellaneous

  • 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.

Support & Troubleshooting & Bugzilla

For troubleshooting and issues encountered by other users see the trouble shooting page.

To enter a new bugzilla you can use the following link:

https://bugs.eclipse.org/bugs/enter_bug.cgi?product=EMFT&component=Texo&version=0.9.0

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

Backward Compatibility

Starting from the 0.9.0 version backward compatibility related topics will be published in this section.

0.9.0 - Version 28 December 2014

  • This issue 420913 is resolved. There is a property of the EPackage or EReference generation annotation which controls if bi-directional association support is generated in the java code. This was not working correctly, in that to get this to be working also the 'Generate save many access' on the EPackage gen annotation should be set to true. This was not correct in, also without setting this additional property, bi-directional access should be generated correctly. This is now resolved. Note bi-directional access is (and was) 'true'/enabled by default. This can mean that newly generated code (previously generated by a previous Texo version) will change as now the bi-directional property is correctly considered. To keep the old behavior, create an annotation model which sets generateBidirectionalAssociationSupport to false (see here for an example, only the generateBidirectionalAssociationSupport part is relevant for this bullet).
  • The createModelObject method of the ModelFactory has been changed to return a parameterized ModelObject (ModelObject<T>) instead of earlier the ModelObject<?>. With this it is not needed anymore to cast the returned value from createModelObject.

Developing

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

Future Topics

This is a list of future topics which we may (or may not) work on in the future, it is a list of ideas:

  • Runtime Layer
    • Backend Store: nosql database, elasticsearch
    • WebService Support: odata integration
    • Integrated with EMF Client Platform
    • Introduce service oriented architecture concepts, focusing on micro-service architectures
    • integrate with OLAP/Mondrian solutions, back-end and front-end
    • develop a generic (and extendable) mobile/html5 model editor which can/should support most models out of the box
    • support code generation which generates separate source files which can be manually changed, so not following the @generated pattern used in standard EMF
    • use this generic model editor as a basis for a generated model editor in html5/mobile
    • integrate with full text indexing and search for the JSON/XML web service layer, incorporate this in the generic model editor
  • Code/Artifact Generation:
    • Support JPA 2.1
    • Support Ecore/XCore generic types
    • Support Ecore/XCore operations
    • Add JPA/Texo annotation support in Xcore

Feel free to react on the EMFT newsgroup with more ideas.

See also

Back to the top