Download - Eclipse india day 2011 EMFT Texo Project
www.JazzTeam.orgwww.springsite.com
Bangalore, 2011, May 6th
Eclipse Foundation
EMFT Texo ProjectMDD FUTURE
Dzmitry Harachka (Belarus)
www.JazzTeam.orgwww.springsite.com
Bangalore, 2011, May 6th
Eclipse Foundation
Agenda
• Why do we need texo: cases from a life
• Texo introduction
• Pros of Texo
• Project architecture
• Future Plans
• Rich Web UI integration: JSON Web Service
www.JazzTeam.orgwww.springsite.com
Bangalore, 2011, May 6th
Eclipse Foundation
Case 1
• You need Java Beans
• You need ORM
• You need Web Rich Client UI integration through JSON Rest Web Service
• Or JAXB based Web Service
• First of all you need model = xsd or ecore
www.JazzTeam.orgwww.springsite.com
Bangalore, 2011, May 6th
Eclipse Foundation
Case 2
• XSD with the model of some content types/blocks from a web site
• XSD based CMS (Content Management System)– Output is XML files
• In-Memory Model Runtime or ORM
• Work with model in Java
• First of all you need a model
www.JazzTeam.orgwww.springsite.com
Bangalore, 2011, May 6th
Eclipse Foundation
Texo• In Latin = construct, build
– MDD extendable technology for generating different artifacts using templates, runtime for generated java beans meta-information, facilities for working with generated artifacts on different environments, e.g. JSON Web Service
• Part of Eclipse Development Environment– All modules are Eclipse plugins = OSGI bundles
• Built on the top of EMF technologies– Xpand for templating and code generating– Ecore as model representation + built in editors– XML/XMI serialization
www.JazzTeam.orgwww.springsite.com
Bangalore, 2011, May 6th
Eclipse Foundation
Texo
• Runtime access to POJO beans ECore meta-information– Generate ECore and POJO wrappers
www.JazzTeam.orgwww.springsite.com
Bangalore, 2011, May 6th
Eclipse Foundation
Texo
XSD Java POJO
EMF ECore Java Texo meta model
Java Texo In-Memory Runtime
Templates
ORM
JSON + JS
has access to all
www.JazzTeam.orgwww.springsite.com
Bangalore, 2011, May 6th
Eclipse Foundation
Texo Internal Data Flow
www.JazzTeam.orgwww.springsite.com
Bangalore, 2011, May 6th
Eclipse Foundation
Texo Pros
• Code generation inside dev. env (in comparison with UML based generators)
• POJO Java Beans– No runtime/compilation dependencies on
texo jars• No specific annotations• No inheritance from Texo classes (as in EMF
code generation)
• Code formatting and code merging– @generated and @NotGenerated
www.JazzTeam.orgwww.springsite.com
Bangalore, 2011, May 6th
Eclipse Foundation
Texo Pros
• Override and change standard templates– Detailed control over generated artifact
blocks through built-in annotations model
• Rather easy to introduce new generation type– Annotations model– Templates– Read annotations and generator code
www.JazzTeam.orgwww.springsite.com
Bangalore, 2011, May 6th
Eclipse Foundation
Testing environment
• Hudson
• Buckminster (consider as “maven for OSGI bundles”)
• Ant
• Three steps tests– Build code generation plugin– Generate code– Run unit tests on the build code
www.JazzTeam.orgwww.springsite.com
Bangalore, 2011, May 6th
Eclipse Foundation
XSD vs ECore
• XSD– Choice– Sequence– Any types
• Ecore– UML like– closer to OOP– Type safety– Work with a model in a simple way
www.JazzTeam.orgwww.springsite.com
Bangalore, 2011, May 6th
Eclipse Foundation
Reflexion vs ECore
• Why not use reflexion (and annotations) and generate artifacts basing on it– Ecore meta-information access is faster– We would like to have POJO beans– We want to access business methods of
model but not all the methods of POJO (toString and others)
www.JazzTeam.orgwww.springsite.com
Bangalore, 2011, May 6th
Eclipse Foundation
Ecore and Texo model classes
www.JazzTeam.orgwww.springsite.com
Bangalore, 2011, May 6th
Eclipse Foundation
Future Plans
• JPA
• JAXB
• XML and JSON REST
• Web UI Rich JS Client integration– Pages and content blocks generation
• Generic architecture for quick conversion from EMF Ecore to any other format
• Other not EMF based code generation patterns
www.JazzTeam.orgwww.springsite.com
Bangalore, 2011, May 6th
Eclipse Foundation
Questions
• http://wiki.eclipse.org/Texo/ • http://download.eclipse.org/modeling/emft/texo/updates/
interim/
• Dzmitry Harachka (Belarus)– http://www.zmicer.com – http://www.jazzteam.org– [email protected]– @zmicercom (a link to presentation at slideshare is
available here)– http://www.linkedin.com/in/dzmitryharachka
www.JazzTeam.orgwww.springsite.com
Bangalore, 2011, May 6th
Eclipse Foundation
Links
• http://wiki.eclipse.org/Xpand
• http://www.eclipse.org/modeling/emf/
• http://www.eclipse.org/modeling/emft/
• http://wiki.eclipse.org/Teneo (Texo’ predecessor)
• http://en.wikipedia.org/wiki/XML_Metadata_Interchange
• http://www.eclipse.org/buckminster/
– http://www.eclipse.org/modeling/emft/b3/
• http://wiki.eclipse.org/Texo/Template_Overriding