Telosys tutorial - Code generation for a Python web application based on Bottle and SQLAlchemy

Laurent Guérin
Laurent GuérinJava Architect - Telosys project leader à Sogeti
1
Telosys tutorial
for
Python – MVC / SQL application
2
Web browser
APPLICATION ARCHITECTURE
Controllers Services
Views
D.A.O.
Entities
What we want to generate :
3
For this tutorial we need Python 3 with frameworks « Bottle » and « SQLAlchemy »
Check « Python 3 » and « pip » are installed
> python --version
> pip --version
Install « Bottle »
> pip install bottle
Install « SQLAlchemy »
> pip install SQLAlchemy
List installed packages
> pip list
PREREQUISITES
4
Telosys CLI
installation
5
Create 2 folders : « tuto » and « tuto/project »
Check Java version ( Java 1.8 or + required )
> java -version
Download Telosys-CLI
from https://www.telosys.org/download/telosys-cli/
in « tuto » folder
Unzip Telosys-CLI in the « tuto » folder
If you want Telosys to use your preferred editor
just define it in the ”telosys-cli.cfg” file
Example for « Notepad++ » :
EditorCommand = "C:/Program Files (x86)/Notepad++/notepad++.exe" $FILE
INSTALL TELOSYS-CLI
Telosys-CLI files after « unzip » :
Telosys-CLI is packaged
in a “.zip” file
6
Open a Command Prompt in « tuto » folder
and run « tt » command (shell file or .bat file )
Print commands help :
telosys> ?
Print current directory :
telosys> pwd
Change current directory to « tuto /project »
telosys> cd project
Set home directory ( project directory ) :
telosys> h .
Initialize the Telosys tools in the project :
telosys> init
LAUNCH TELOSYS-CLI AND INITIALIZE THE PROJECT
7
Step 1 - Model setup
( entities definition )
8
Create a new model « students » :
telosys> nm students
List existing models :
telosys> lm
List entities defined in the current model :
telosys> le
Create a new entity « student » :
telosys> ne student
List entities :
telosys> le
Edit entity « student »
telosys> ee student
Check the current model
telosys> cm
HOW TO CREATE A MODEL FROM SCRATCH
The current model is
displayed in the prompt
9
If you don’t want to create a full model from scratch
you can download an existing model :
http://www.telosys.org/download/models-v3/
In « /tuto/project/TelosysTools »
Unzip ( « Extract here » )
List models :
telosys> lm
Select the « cars » model :
telosys> m cars
List entities :
telosys> le
Edit entity « Car »:
telosys> ee car
DOWNLOAD THE « CARS » MODEL
10
Step 2 - Templates installation
11
PYTHON BUNDLES AVAILABLE ON GITHUB
See : https://github.com/telosys-templates-v3
12
For our application we need 2 bundles of templates :
• 1 bundle for the persistence layer
• 1 bundle for the web MVC layer
REQUIRED BUNDLES OF TEMPLATES
Web browser
Controllers Services
Views
D.A.O.
Entities
python-web-mvc-bottle python-persistence-sqlalchemy
13
Print current GitHub store :
telosys> gh
List all bundles available on GitHub :
telosys> lgh
List bundles containing “pyt” on GitHub :
telosys> lgh pyt
Install bundles containing “pyt” :
telosys> ib pyt
List installed bundles :
telosys> lb
INSTALL BUNDLES OF TEMPLATES
14
Step 3 - Code generation
15
Select the bundle of templates for the MVC layer ( “python-web-mvc-bottle” )
 select bundle containing “mvc” :
telosys> b mvc
Launch generation :
telosys> gen * * -r
( generate all entities
target files using
all templates and
copy static resources
if any )
USE « Web MVC » FOR CODE GENERATION
16
For each entity :
• “form” template
• “list” template
« Web MVC » GENERATION RESULT
A controller for each entity
Home page controller
& utility functions
17
Select bundle containing “sqlal” :
telosys> b sqlal
Launch generation :
telosys> gen * * -r
USE « Persistence SQL Alchemy » FOR CODE GENERATION
18
« Persistence SQL Alchemy » GENERATION RESULT
A DAO for each entity
A domain class for each entity
A persistence service for each entity
A unit test for each DAO
19
Now let’s use the
generated code…
20
Initialize database and launch DAO tests
1) Create the SQLite database
Launch “create_database.py”
( creates the SQLite file “database.sqlite” )
2) Initialize the database :
Launch “init_database.py”
( insert few records in each table )
3) Launch DAO unit tests :
Launch “run_tests.py”
21
1) Start the web application
Launch “app.py”
( creates the SQLite file “database.sqlite” )
2) Test the application with a web browser
http://localhost:3000/
Launch the generated web application
22
That's it !
Now you can customize
the entities or the templates…
1 sur 22

Recommandé

Telosys project booster Paris Open Source Summit 2019 par
Telosys project booster Paris Open Source Summit 2019Telosys project booster Paris Open Source Summit 2019
Telosys project booster Paris Open Source Summit 2019Laurent Guérin
5.9K vues23 diapositives
An Intro into webpack par
An Intro into webpackAn Intro into webpack
An Intro into webpackSquash Apps Pvt Ltd
1.1K vues20 diapositives
Android animation par
Android animationAndroid animation
Android animationKrazy Koder
3.7K vues22 diapositives
Understanding Sling Models in AEM par
Understanding Sling Models in AEMUnderstanding Sling Models in AEM
Understanding Sling Models in AEMAccunity Software
7.9K vues38 diapositives
An Introduction of Node Package Manager (NPM) par
An Introduction of Node Package Manager (NPM)An Introduction of Node Package Manager (NPM)
An Introduction of Node Package Manager (NPM)iFour Technolab Pvt. Ltd.
1.4K vues17 diapositives
An intro to Docker, Terraform, and Amazon ECS par
An intro to Docker, Terraform, and Amazon ECSAn intro to Docker, Terraform, and Amazon ECS
An intro to Docker, Terraform, and Amazon ECSYevgeniy Brikman
31.5K vues98 diapositives

Contenu connexe

Tendances

Solid NodeJS with TypeScript, Jest & NestJS par
Solid NodeJS with TypeScript, Jest & NestJSSolid NodeJS with TypeScript, Jest & NestJS
Solid NodeJS with TypeScript, Jest & NestJSRafael Casuso Romate
6.7K vues31 diapositives
Docker Introduction par
Docker IntroductionDocker Introduction
Docker IntroductionJeffrey Ellin
631 vues35 diapositives
Design Pattern - Factory Method Pattern par
Design Pattern - Factory Method PatternDesign Pattern - Factory Method Pattern
Design Pattern - Factory Method PatternMudasir Qazi
5.1K vues13 diapositives
Nodejs presentation par
Nodejs presentationNodejs presentation
Nodejs presentationArvind Devaraj
8.8K vues17 diapositives
Introduction Node.js par
Introduction Node.jsIntroduction Node.js
Introduction Node.jsErik van Appeldoorn
15.4K vues39 diapositives
Java 8-streams-collectors-patterns par
Java 8-streams-collectors-patternsJava 8-streams-collectors-patterns
Java 8-streams-collectors-patternsJosé Paumard
31.1K vues451 diapositives

Tendances(20)

Design Pattern - Factory Method Pattern par Mudasir Qazi
Design Pattern - Factory Method PatternDesign Pattern - Factory Method Pattern
Design Pattern - Factory Method Pattern
Mudasir Qazi5.1K vues
Java 8-streams-collectors-patterns par José Paumard
Java 8-streams-collectors-patternsJava 8-streams-collectors-patterns
Java 8-streams-collectors-patterns
José Paumard31.1K vues
Microservices-DDD-Telosys-Devoxx-FR-2022 par Laurent Guérin
Microservices-DDD-Telosys-Devoxx-FR-2022Microservices-DDD-Telosys-Devoxx-FR-2022
Microservices-DDD-Telosys-Devoxx-FR-2022
Laurent Guérin203 vues
Crafted Design - ITAKE 2014 par Sandro Mancuso
Crafted Design - ITAKE 2014Crafted Design - ITAKE 2014
Crafted Design - ITAKE 2014
Sandro Mancuso12.4K vues
Maven Basics - Explained par Smita Prasad
Maven Basics - ExplainedMaven Basics - Explained
Maven Basics - Explained
Smita Prasad1.1K vues
Javascript Design Patterns par Lilia Sfaxi
Javascript Design PatternsJavascript Design Patterns
Javascript Design Patterns
Lilia Sfaxi3.5K vues
From framework coupled code to #microservices through #DDD /by @codelytv par CodelyTV
From framework coupled code to #microservices through #DDD /by @codelytvFrom framework coupled code to #microservices through #DDD /by @codelytv
From framework coupled code to #microservices through #DDD /by @codelytv
CodelyTV1.5K vues
Hibernate par Sunil OS
Hibernate Hibernate
Hibernate
Sunil OS511K vues
An introduction to Maven par Joao Pereira
An introduction to MavenAn introduction to Maven
An introduction to Maven
Joao Pereira7.9K vues

Similaire à Telosys tutorial - Code generation for a Python web application based on Bottle and SQLAlchemy

Mon application web en 20 minutes par
Mon application web en 20 minutesMon application web en 20 minutes
Mon application web en 20 minutesOpen Source Experience
52 vues21 diapositives
My web application in 20 minutes with Telosys par
My web application in 20 minutes with Telosys My web application in 20 minutes with Telosys
My web application in 20 minutes with Telosys Laurent Guérin
347 vues21 diapositives
PVS-Studio Is Now in Chocolatey: Checking Chocolatey under Azure DevOps par
PVS-Studio Is Now in Chocolatey: Checking Chocolatey under Azure DevOpsPVS-Studio Is Now in Chocolatey: Checking Chocolatey under Azure DevOps
PVS-Studio Is Now in Chocolatey: Checking Chocolatey under Azure DevOpsAndrey Karpov
51 vues11 diapositives
Docker Starter Pack par
Docker Starter PackDocker Starter Pack
Docker Starter PackSaeed Hajizade
26 vues49 diapositives
Overview of CSharp MVC3 and EF4 par
Overview of CSharp MVC3 and EF4Overview of CSharp MVC3 and EF4
Overview of CSharp MVC3 and EF4Rich Helton
2.4K vues173 diapositives
Azure DevOps Extensions par
Azure DevOps ExtensionsAzure DevOps Extensions
Azure DevOps ExtensionsChristian Waha
275 vues26 diapositives

Similaire à Telosys tutorial - Code generation for a Python web application based on Bottle and SQLAlchemy (20)

My web application in 20 minutes with Telosys par Laurent Guérin
My web application in 20 minutes with Telosys My web application in 20 minutes with Telosys
My web application in 20 minutes with Telosys
Laurent Guérin347 vues
PVS-Studio Is Now in Chocolatey: Checking Chocolatey under Azure DevOps par Andrey Karpov
PVS-Studio Is Now in Chocolatey: Checking Chocolatey under Azure DevOpsPVS-Studio Is Now in Chocolatey: Checking Chocolatey under Azure DevOps
PVS-Studio Is Now in Chocolatey: Checking Chocolatey under Azure DevOps
Andrey Karpov51 vues
Overview of CSharp MVC3 and EF4 par Rich Helton
Overview of CSharp MVC3 and EF4Overview of CSharp MVC3 and EF4
Overview of CSharp MVC3 and EF4
Rich Helton2.4K vues
Microservices Server - MSS Workshop par WSO2
Microservices Server - MSS WorkshopMicroservices Server - MSS Workshop
Microservices Server - MSS Workshop
WSO23.4K vues
Workshop/Tutorial WSO2 Micro Services Server par Edgar Silva
Workshop/Tutorial WSO2 Micro Services ServerWorkshop/Tutorial WSO2 Micro Services Server
Workshop/Tutorial WSO2 Micro Services Server
Edgar Silva2.1K vues
Workshop MSF4J - Getting Started with Microservices and Java par Edgar Silva
Workshop MSF4J - Getting Started with Microservices and JavaWorkshop MSF4J - Getting Started with Microservices and Java
Workshop MSF4J - Getting Started with Microservices and Java
Edgar Silva2.2K vues
Openshift cheat rhce_r3v1 rhce par Darnette A
Openshift cheat rhce_r3v1 rhceOpenshift cheat rhce_r3v1 rhce
Openshift cheat rhce_r3v1 rhce
Darnette A298 vues
Steps how to create active x using visual studio 2008 par Yudep Apoi
Steps how to create active x using visual studio 2008Steps how to create active x using visual studio 2008
Steps how to create active x using visual studio 2008
Yudep Apoi9K vues
Cello Saas getting started par kanimozhin
Cello Saas getting startedCello Saas getting started
Cello Saas getting started
kanimozhin207 vues
Refresh Austin - Intro to Dexy par ananelson
Refresh Austin - Intro to DexyRefresh Austin - Intro to Dexy
Refresh Austin - Intro to Dexy
ananelson668 vues
CelloSaaS Getting Started par Techcello
CelloSaaS Getting StartedCelloSaaS Getting Started
CelloSaaS Getting Started
Techcello923 vues
AWS December 2015 Webinar Series - Continuous Delivery to Amazon EC2 Containe... par Amazon Web Services
AWS December 2015 Webinar Series - Continuous Delivery to Amazon EC2 Containe...AWS December 2015 Webinar Series - Continuous Delivery to Amazon EC2 Containe...
AWS December 2015 Webinar Series - Continuous Delivery to Amazon EC2 Containe...
Introduction to Docker - Vellore Institute of Technology par Ajeet Singh Raina
Introduction to Docker - Vellore Institute of TechnologyIntroduction to Docker - Vellore Institute of Technology
Introduction to Docker - Vellore Institute of Technology

Plus de Laurent Guérin

MQTT avec Mosquitto et Paho - DevFest Brest 2019 par
MQTT avec Mosquitto et Paho - DevFest Brest 2019MQTT avec Mosquitto et Paho - DevFest Brest 2019
MQTT avec Mosquitto et Paho - DevFest Brest 2019Laurent Guérin
754 vues56 diapositives
MQTT avec Mosquitto et Paho - Laurent Guerin - JUG Nantes Nov 2018 par
MQTT avec Mosquitto et Paho - Laurent Guerin - JUG Nantes Nov 2018MQTT avec Mosquitto et Paho - Laurent Guerin - JUG Nantes Nov 2018
MQTT avec Mosquitto et Paho - Laurent Guerin - JUG Nantes Nov 2018Laurent Guérin
1.2K vues48 diapositives
Meetup python-bottle-telosys-2018-lgu-v1.0 par
Meetup python-bottle-telosys-2018-lgu-v1.0Meetup python-bottle-telosys-2018-lgu-v1.0
Meetup python-bottle-telosys-2018-lgu-v1.0Laurent Guérin
520 vues39 diapositives
Sogeti labs developer-today-v1.1 par
Sogeti labs developer-today-v1.1Sogeti labs developer-today-v1.1
Sogeti labs developer-today-v1.1Laurent Guérin
2.4K vues17 diapositives
DevOps MeetUp NL - Docker (Oct 2014) par
DevOps MeetUp NL - Docker (Oct 2014)DevOps MeetUp NL - Docker (Oct 2014)
DevOps MeetUp NL - Docker (Oct 2014)Laurent Guérin
2.3K vues42 diapositives
Telosys tools jug-nantes-2014-v1.2 par
Telosys tools jug-nantes-2014-v1.2Telosys tools jug-nantes-2014-v1.2
Telosys tools jug-nantes-2014-v1.2Laurent Guérin
2K vues67 diapositives

Plus de Laurent Guérin(11)

MQTT avec Mosquitto et Paho - DevFest Brest 2019 par Laurent Guérin
MQTT avec Mosquitto et Paho - DevFest Brest 2019MQTT avec Mosquitto et Paho - DevFest Brest 2019
MQTT avec Mosquitto et Paho - DevFest Brest 2019
Laurent Guérin754 vues
MQTT avec Mosquitto et Paho - Laurent Guerin - JUG Nantes Nov 2018 par Laurent Guérin
MQTT avec Mosquitto et Paho - Laurent Guerin - JUG Nantes Nov 2018MQTT avec Mosquitto et Paho - Laurent Guerin - JUG Nantes Nov 2018
MQTT avec Mosquitto et Paho - Laurent Guerin - JUG Nantes Nov 2018
Laurent Guérin1.2K vues
Meetup python-bottle-telosys-2018-lgu-v1.0 par Laurent Guérin
Meetup python-bottle-telosys-2018-lgu-v1.0Meetup python-bottle-telosys-2018-lgu-v1.0
Meetup python-bottle-telosys-2018-lgu-v1.0
Laurent Guérin520 vues
DevOps MeetUp NL - Docker (Oct 2014) par Laurent Guérin
DevOps MeetUp NL - Docker (Oct 2014)DevOps MeetUp NL - Docker (Oct 2014)
DevOps MeetUp NL - Docker (Oct 2014)
Laurent Guérin2.3K vues
Devoxx 2011 - Scaffolding with Telosys par Laurent Guérin
Devoxx 2011 - Scaffolding with TelosysDevoxx 2011 - Scaffolding with Telosys
Devoxx 2011 - Scaffolding with Telosys
Laurent Guérin1.7K vues
Open World Forum 2009 Migration With Telosys par Laurent Guérin
Open World Forum 2009 Migration With TelosysOpen World Forum 2009 Migration With Telosys
Open World Forum 2009 Migration With Telosys
Laurent Guérin1K vues
Solutions Linux Développement Rapide Java par Laurent Guérin
Solutions Linux Développement Rapide JavaSolutions Linux Développement Rapide Java
Solutions Linux Développement Rapide Java
Laurent Guérin1K vues

Dernier

20231129 - Platform @ localhost 2023 - Application-driven infrastructure with... par
20231129 - Platform @ localhost 2023 - Application-driven infrastructure with...20231129 - Platform @ localhost 2023 - Application-driven infrastructure with...
20231129 - Platform @ localhost 2023 - Application-driven infrastructure with...sparkfabrik
7 vues46 diapositives
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI... par
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI...Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI...
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI...Marc Müller
41 vues83 diapositives
Top-5-production-devconMunich-2023.pptx par
Top-5-production-devconMunich-2023.pptxTop-5-production-devconMunich-2023.pptx
Top-5-production-devconMunich-2023.pptxTier1 app
7 vues40 diapositives
EV Charging App Case par
EV Charging App Case EV Charging App Case
EV Charging App Case iCoderz Solutions
5 vues1 diapositive
Advanced API Mocking Techniques par
Advanced API Mocking TechniquesAdvanced API Mocking Techniques
Advanced API Mocking TechniquesDimpy Adhikary
19 vues11 diapositives
ShortStory_qlora.pptx par
ShortStory_qlora.pptxShortStory_qlora.pptx
ShortStory_qlora.pptxpranathikrishna22
5 vues10 diapositives

Dernier(20)

20231129 - Platform @ localhost 2023 - Application-driven infrastructure with... par sparkfabrik
20231129 - Platform @ localhost 2023 - Application-driven infrastructure with...20231129 - Platform @ localhost 2023 - Application-driven infrastructure with...
20231129 - Platform @ localhost 2023 - Application-driven infrastructure with...
sparkfabrik7 vues
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI... par Marc Müller
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI...Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI...
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI...
Marc Müller41 vues
Top-5-production-devconMunich-2023.pptx par Tier1 app
Top-5-production-devconMunich-2023.pptxTop-5-production-devconMunich-2023.pptx
Top-5-production-devconMunich-2023.pptx
Tier1 app7 vues
Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ... par Donato Onofri
Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ...Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ...
Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ...
Donato Onofri860 vues
2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx par animuscrm
2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx
2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx
animuscrm15 vues
Bootstrapping vs Venture Capital.pptx par Zeljko Svedic
Bootstrapping vs Venture Capital.pptxBootstrapping vs Venture Capital.pptx
Bootstrapping vs Venture Capital.pptx
Zeljko Svedic12 vues
Fleet Management Software in India par Fleetable
Fleet Management Software in India Fleet Management Software in India
Fleet Management Software in India
Fleetable11 vues
Software evolution understanding: Automatic extraction of software identifier... par Ra'Fat Al-Msie'deen
Software evolution understanding: Automatic extraction of software identifier...Software evolution understanding: Automatic extraction of software identifier...
Software evolution understanding: Automatic extraction of software identifier...
JioEngage_Presentation.pptx par admin125455
JioEngage_Presentation.pptxJioEngage_Presentation.pptx
JioEngage_Presentation.pptx
admin1254556 vues

Telosys tutorial - Code generation for a Python web application based on Bottle and SQLAlchemy

  • 1. 1 Telosys tutorial for Python – MVC / SQL application
  • 2. 2 Web browser APPLICATION ARCHITECTURE Controllers Services Views D.A.O. Entities What we want to generate :
  • 3. 3 For this tutorial we need Python 3 with frameworks « Bottle » and « SQLAlchemy » Check « Python 3 » and « pip » are installed > python --version > pip --version Install « Bottle » > pip install bottle Install « SQLAlchemy » > pip install SQLAlchemy List installed packages > pip list PREREQUISITES
  • 5. 5 Create 2 folders : « tuto » and « tuto/project » Check Java version ( Java 1.8 or + required ) > java -version Download Telosys-CLI from https://www.telosys.org/download/telosys-cli/ in « tuto » folder Unzip Telosys-CLI in the « tuto » folder If you want Telosys to use your preferred editor just define it in the ”telosys-cli.cfg” file Example for « Notepad++ » : EditorCommand = "C:/Program Files (x86)/Notepad++/notepad++.exe" $FILE INSTALL TELOSYS-CLI Telosys-CLI files after « unzip » : Telosys-CLI is packaged in a “.zip” file
  • 6. 6 Open a Command Prompt in « tuto » folder and run « tt » command (shell file or .bat file ) Print commands help : telosys> ? Print current directory : telosys> pwd Change current directory to « tuto /project » telosys> cd project Set home directory ( project directory ) : telosys> h . Initialize the Telosys tools in the project : telosys> init LAUNCH TELOSYS-CLI AND INITIALIZE THE PROJECT
  • 7. 7 Step 1 - Model setup ( entities definition )
  • 8. 8 Create a new model « students » : telosys> nm students List existing models : telosys> lm List entities defined in the current model : telosys> le Create a new entity « student » : telosys> ne student List entities : telosys> le Edit entity « student » telosys> ee student Check the current model telosys> cm HOW TO CREATE A MODEL FROM SCRATCH The current model is displayed in the prompt
  • 9. 9 If you don’t want to create a full model from scratch you can download an existing model : http://www.telosys.org/download/models-v3/ In « /tuto/project/TelosysTools » Unzip ( « Extract here » ) List models : telosys> lm Select the « cars » model : telosys> m cars List entities : telosys> le Edit entity « Car »: telosys> ee car DOWNLOAD THE « CARS » MODEL
  • 10. 10 Step 2 - Templates installation
  • 11. 11 PYTHON BUNDLES AVAILABLE ON GITHUB See : https://github.com/telosys-templates-v3
  • 12. 12 For our application we need 2 bundles of templates : • 1 bundle for the persistence layer • 1 bundle for the web MVC layer REQUIRED BUNDLES OF TEMPLATES Web browser Controllers Services Views D.A.O. Entities python-web-mvc-bottle python-persistence-sqlalchemy
  • 13. 13 Print current GitHub store : telosys> gh List all bundles available on GitHub : telosys> lgh List bundles containing “pyt” on GitHub : telosys> lgh pyt Install bundles containing “pyt” : telosys> ib pyt List installed bundles : telosys> lb INSTALL BUNDLES OF TEMPLATES
  • 14. 14 Step 3 - Code generation
  • 15. 15 Select the bundle of templates for the MVC layer ( “python-web-mvc-bottle” )  select bundle containing “mvc” : telosys> b mvc Launch generation : telosys> gen * * -r ( generate all entities target files using all templates and copy static resources if any ) USE « Web MVC » FOR CODE GENERATION
  • 16. 16 For each entity : • “form” template • “list” template « Web MVC » GENERATION RESULT A controller for each entity Home page controller & utility functions
  • 17. 17 Select bundle containing “sqlal” : telosys> b sqlal Launch generation : telosys> gen * * -r USE « Persistence SQL Alchemy » FOR CODE GENERATION
  • 18. 18 « Persistence SQL Alchemy » GENERATION RESULT A DAO for each entity A domain class for each entity A persistence service for each entity A unit test for each DAO
  • 19. 19 Now let’s use the generated code…
  • 20. 20 Initialize database and launch DAO tests 1) Create the SQLite database Launch “create_database.py” ( creates the SQLite file “database.sqlite” ) 2) Initialize the database : Launch “init_database.py” ( insert few records in each table ) 3) Launch DAO unit tests : Launch “run_tests.py”
  • 21. 21 1) Start the web application Launch “app.py” ( creates the SQLite file “database.sqlite” ) 2) Test the application with a web browser http://localhost:3000/ Launch the generated web application
  • 22. 22 That's it ! Now you can customize the entities or the templates…