2. Who’s speaking ?
By day
Senior architect
at
@ltguerinLaurent Guérin
Open Source supporter
Passionate by software engineering
and development industrialization
By night
Creator of
code generator
3. @telosys http://www.telosys.org 3
The problem…
In all projects
(whatever the language or framework)
developers spend a lot of time coding repetitive
and uninteresting portions of code
it costs a lot
and it does not have any added value !
4. @telosys http://www.telosys.org 4
Impact of entities
domain class, web page,
D.A.O., REST controllers,
database table, tests, etc.
N times…N entities
The loss of time is proportional to the
number of entities managed by the project
=>
5. @telosys http://www.telosys.org 5
Code generation can help
Platform ( Java EE, PHP, Python, …)
Application
Framework 1 Framework 2
Repetitive code
Repetitive code parts can be generated.
Specific code with value added
Generator
Developer
8. @telosys http://www.telosys.org 8
Telosys is light and non intrusive
It's just a development accelerator
(lightweight tool)
It does not require a strategic choice
on the part of the company
You can start using it in minutes
(very short learning curve)
You can remove it after use (the generated
code is completely independent of the tool)
Lightness and independence
9. @telosys http://www.telosys.org 9
Telosys is open and customizable (not a “black box”)
?
You can adapt the models
and the code templates
The resulting code is
exactly what you want
!
11. @telosys http://www.telosys.org 11
Abstract model
DSL model
How it works ?
Database model
Step 1 : Define your entities in a model
init/update
Telosys offers 2 types of models :
« DB model »
A model created from a relational
database schema
(you can customize it after creation)
« DSL model »
A model created from scratch,
based on text files with a very
simple grammar
13. @telosys http://www.telosys.org 13
Project
templates
How it works ?
Standard templates
GitHub
Download
predefined
standard
templates
Creating/customizing
templates for specific cases
Step 2 : Download (or create) templates
Each template is designed to
generate a certain type of file
(DAO, controller, etc.)
in a target language (Java,
PHP, etc.)
14. @telosys http://www.telosys.org 14
What does a template look like?
http://velocity.apache.org/
Model objects
“entities”,
“attributes”, etc.
Environment objects
Velocity Template Language (VTL)
• Predefined objects : $, ${…}
• Directives : #set, #if, #foreach, …
• Comments : ## #* .. *#
16. @telosys http://www.telosys.org 16
What can we generate?
Any type of "text file“ that means any language :
Java, Python, JavaScript, PHP, Golang, XML, JSP, Scala,
SQL, HTML, C#, TypeScript, etc.
1 entity N templates N targets
N entities 1 template 1 target
model
(all entities
with links)
+
variables
1 bean
1 controller
1 web page
1 list
a template can generate N files (1 for each entity) or 1 single file
17. @telosys http://www.telosys.org 17
Concept of “bundle”
Templates are organized in “bundles”
You can choose which part of the application you will generate
Bundle « A » Bundle « B » Bundle « C » Bundle « D » Bundle « E »
18. @telosys http://www.telosys.org 18
Significant gains
It can save many days of workload
The productivity gain is maximum when reusing existing templates
Application
generated
code
"handmade“
code
Very limited cost : from zero to few days
(only the workload to create or customize the templates)
Find a
balance
time gained
time invested in
models & templates