SlideShare a Scribd company logo
1 of 48
Download to read offline
A pragmatic scaffolding approach
to build Java Web Applications
Laurent Guérin
Telosys Project Leader
Sogeti & OW2 Consortium
Introduction
                                                         Sogeti : Company                              Capgemini : Company
                                                                                          belongs to




                                                                                                            : Plateform
     Laurent Guérin : Person                              Telosys : Project
                                      leads

     laurent.guerin@sogeti.com

                                                                                                               : IDE
         located in
                                                                       hosts

                                                         OW2 : Consortium
                                                                                                             : License

          France : Country




Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org )                                      2
Introduction

                                                OUTLINE :

                                                  - Code generation

                                                  - Telosys approach

                                                  - The framework

                                                  - The tools (demo)
Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org )   3
About code generation …
Model Driven
  • "Model-First" approach ( MDD, MDA, … )
  • Code generation from an existing model
  • "Model Driven" => You need a model !
  • Model => substantial initial investment
  • Process : keep the model up to date !
                                                       MODEL                                                                                               Split !
                                                                                                                                                  XMI
                                        Service
                                       name




                                     +port 0..n




                                                                                                                                                 ( XML )
                                         Port                      Binding                Port Type
                                                                                     1
                                                       +binding                          name
                                       name                       name                                                   Param
                                                            1                    +type
                                                                                                                        name

                                    StartWithExtensions

                                 +output 0..1             +operation 0..n         +operation 0..n
                                                                                                          +input    Input
                                         0..1 +input
                                                            BindingOperation                  Operation
                                                                                                            0..1




                                                                                                                                                                     Code
                                                           name                              name
                                                                                     1                                0..1 Output
                                                                                                                   +output

                                                                                                                            +message         1
                                                                  +fault 0..n            +fault    0..n
                                                                                                                                 Message
                                                                                                Fault              +message
                                                                  BindingFault                                                  name
                                                                                              name
                                                                                         1                                  1

                                                                                                                                +part 0..n
                                                                                                                                   Part
                                                                                                                                 name




                                                                                                                                                    TOOL
                                                            Template




Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org )                                                                                     5
Scaffolding
  • "Database-first" approach
                                                                                                     Database
  • Very efficient
  • No customization between the database                                                            Metadata


    metadata and the generator
                                                                                                      TOOL
  • Not enough information …
       – Java field name                                                                  Template

       – Java field type
       – Validation rules : min, max, regexp, …                                                        Code
       – Boolean storage values ( 1/0, "T"/"F", … )
       – etc …
  • Cannot store/reuse further information
Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org )                         6
Wizards
  • Code generation without model / DB                                                                   “Java Model”
                                                                                                       org.eclipse.jdt.core


  • IDE tool => Needs user inputs                                                                             Workspace
                                                                                                                files

                                       I.D.E.
  • Can also use existing artefacts
    as input
       – Java class  Java class
       – WSDL file  Java classes
  • Efficient only for a few kinds of
    targets
                                                                                                         Code
  • Can only be considered as                                                                Bulk
                                                                                          generation

    "development accelerators"
Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org )                                   7
The Telosys approach
Telosys approach
  • What we want …
       – to be able to generate code quickly for entities
        management (like scaffolding) with a simple tool
       – to add and keep specific information about entities
        => we need a repository to store them (kind of model)
  • What we don’t want …
       – to spend a lot of time to build a model
       – to input further information for each generation
  • What we must have …
       – a database (“database first”)      Metadata
                                                                                          DB
                                                                                               +
       – an IDE (Eclipse) that is the developer’s daily tool
Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org )            9
Telosys approach
  • The 3 steps …
                                                                                                      Template
                Database           updates                                           customizes




                 Metadata
                                                                     modify
                                                                      & add
                                                                   information                                   Code
               Repository                                                                   Code
               generator                                                                  generator
                                   generates
                                                       Repository
                                                       (Lightweight
                                   updates                model)



     1                                           2                                        3
               Use the                                Customize the                           Generate
          “Database-first”                         “lightweight model”                        the code
         approach to build
       a “lightweight model”

Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org )                                 10
The tripod of success
 What a                                                      Method               ( agile )

 development
 project needs…

                                     Tools                                           Framework

                           ( code generation )                                      ( global & simple )



  • The framework is self-sufficient to build a
    complete Web application
    ( "global" / "full stack" framework )
  • The tools are provided as Eclipse plugins in
    order to make the programmer's life easier
Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org )                   11
Project’s philosophy
  • “Keep it simple and stupid”
             ( KISP ? )
       – lightweight framework
       – small tools (easy to install & to use)
  • “Conform with the standards”
       – servlet/JSP/JSPX, JDBC, JPA, http, XML, …
  • “Remain open”
       – Open Source (hosted by OW2 consortium)
       – Open Format (lightweight model = XML)
       – Customizable templates  different targets :
        Telosys fwk + other Java Frameworks, Flex, PHP, …
Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org )   12
The Telosys framework
The framework
  • Global framework                                                            “all in one“




  • Only one jar     (+ JDBC) => no "jar hell" !
  • Designed for "data centric" web applications
  • Light (just needs a servlet container and a
    database) & based on simple concepts
Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org )        14
The "global effect"
                                                One framework
                                      that covers all the application layers
                                                 Authenti-
                                                  cation

                       Presentation                      Application           Business   Persistence
                                                             Services
                           Screen                                          Java Beans
                            Maps                                             ( POJO )         DAO
                                           XML        conv
                                                                        "VO"                                SQL
                       JSP + taglib                           Screen
                                          AJAX               Managers
                         Framework
                                                                               Services                 Thin persistence
                         Javascript                                                                     layer

                                                                                           Very simple objects
                               Natively AJAX                     Commons, logging, I18N, … ( "Pure POJO" )


 • “Global” means … less “glue”, less objects
   (less memory footprint), less configuration, …
         => Coherence & Efficiency
 • “Modular” (modules usable separately)
Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org )                                    15
The "client-server" paradigm
  • Once the screen is loaded in the browser, it
    converses with the server via AJAX requests
    ( XML / http )
     Client-side                                                      http                        Server-side
                                                    <request screen-name="Employee"
                                                      screen-id="0" action="get" >
                                                    </request>                                       Screen
                                                                                                     Manager
                                          Action




                                                    <response screen-name="Employee"
                                                       screen-id="0" action="get" >
                                                    <return code="0" message="Ok" >
                                                    </return>
                          Framework
                          JavaScript




                                                    <data>
                                                    <employee id="23" lastName="Wayne"
                                                       firstName="John" manager="0" email="" />
                                                    </data>
                                                    </response>

                                                                                                     Service
                                          Service




                                                    http://myhost:8080/.../Add.svc?p1=2&p2=6

                                                    <response service-name="Add">
                                                     <return code="0" message="Ok" />
                                                     <values> <value result="8" /> </values>
                                                     <data> </data>
                                                    </response>




Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org )                         16
The "Data Objects"
  • VO Bean (POJO = “entity record”)                                                                          Code

  • VO List (selectable/sortable list of POJO)
                                                                                                            generator



  • DataSet (grid of objects)
                                                                 Book
                                                                 .java
                                                                                              BookDAO
                  BookConv                                VO Bean                              .java
                   .java
                                                                                           Data
                                                                                                        Database
     XML                  XML                                                             Access
    <…>
                                                           VO List                         Layer                 Book
    </ … >
                                                                                                                 Table
                         Con-                                     BookList
                        verters                                    .java




                                                           DataSet                        Parsers
                                                                                                         Files

Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org )                                  17
The "Data Access Layer"
  • Why another persistence framework ?
                  ORM : JPA (or Hibernate) …
                  High level & "Object Oriented"
                                                                                              Java objects
                  Hides the complexity                                                    rule the persistence
                  Sometimes misunderstood by the developers
                  ( "lazy/eager" loading, cache effects,                                                DB
                  "attached/detached" entities,
                  "owning side"/"inverse side" links, … )                                     new        new


                  Telosys DAL (based on DAO pattern)
                  Intermediate level & "Record Oriented"                                   Database records
                  One Bean = One Record                                                   rule the persistence
                  The developer keeps the control
                  No links, no cache, no byte-code enhancement
                                                                                                        DB
                  Very simple API : load, save, insert, update,
                  exists, loadList, updateList, …                                             new        legacy



                  JDBC API                                                     Both are useful,
                  Low level                                                    You have the choice …
Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org )                           18
"Record Persistence" examples
    A "record" = a bean (POJO)
    Each bean is managed by a dedicated DAO
 EmployeeDAO dao = getDAO();
 Employee employee = new Employee();
 employee.setCode( "123" ); // primary key
 int r = dao.load(employee, db);
                                                                                          The developer decides…
 if ( r > 0 ) { // if found                                                               . What to do
   // update
   employee.setFirstName("Bill");                                                         . How to do it
   dao.update(employee, db);
 }                                                                                        . When to do it
 else {
   // create
   employee.setLastName("Wayne");                                             EmployeeList list = new EmployeeList();
   employee.setFirstName("John");                                             ListQuery query = dao.createQuery(…);
   employee.setEmail("jwayne@cinema.com");                                    int count = dao.count(query, db);
   dao.insert(employee, db);                                                  dao.loadList(query, list, db);
 }                                                                            dao.updateList(list, db);
 if (dao.exists(employee,db)){...}
 dao.delete(employee, db);                                                                  db.commit();
                                                                                            db.rollback();

Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org )                            19
Links or no links ?
  • You have the choice …
  • Links can be generated if an “object graph
    approach” is chosen (ie with JPA persistence)
                                                                                                        Bean
                                                                                          @ManyToOne             Code
                                                                                          @OneToMany           generator
                                                                                          @ManyToMany
                                                                                          @OneToOne



  • With a “record approach” : no need to manage
    links between beans, the framework uses
    “aggregations” to assemble required beans
                                                                                                                 Code
                                                                                             Bean              generator
                                  Aggregation
                                  (composite)                                                DAO


Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org )                                20
The screens
                                                                                                              Code
                                                                                                            generator


                                      request                         BookMgr                 BookProc
           ScreenMap                                                  .java                    .java
                                      response             ScreenManager                  ScreenProcedure
   V                                                                                                        C
                                      AJAX                                                  acts on …

                                                                 BookData
                                                                  .java                   Book (bean)       M
                                                            ScreenData
                                                                                           AuthorList
               Book.jsp                                    (aggregation
               ( or .jspx)
                                                           0 .. N objects)                Shop (bean)
                Book.js                                                                     DataSet


Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org )                             21
Screen view example
   JSP or JSPX, but no HTML !
   <%@ taglib uri="/telosys/widgets" prefix="t" %>

   <t:screenbody>

     <t:label       id="L_EmpId"    x="40" y="60" txt="Employee Id : " cl="PK_field_label" />
     <t:label       id="L_LastName" x="40" y="100" txt="Last name : " />
     <t:label       id="L_FirstName" x="40" y="140" txt="First name : " />
     <t:label       id="L_Birthdate" x="40" y="180" txt="Birthdate : " />

     <t:field x="200" y="60" id="EmpId" cl="PK_field" size="6" maxlength="6" />
     <t:field x="200" y="100" id="LastName"    size="30" maxlength="30" value="Aaaa" />

     <t:button x="460" y="100" id="b1" txt="My button" onclick="b1_onClick();"            />

     <t:field x="200" y="140" id="FirstName" size="30" maxlength="30" value="Georges" />
     <t:field x="200" y="180" id="Birthdate" size="10" maxlength="10" value="" type="Date" />

     <t:radiogroup id="Contract" x="200" y="220">
      <t:radioitem id="R_field61" x="0" y="0" value="1" txt="C.D.D. (1)" />
      <t:radioitem id="R_field62" x="0" y="20" value="2" txt="C.D.I. (2)" />
     </t:radiogroup >

     <t:checkbox id="Manager" x="340" y="220" value="1" valueoff="9" txt="Manager"             />

   </t:screenbody >

Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org )             22
Conventions
  • "Framework" => "Frame" !
  • "CoC" ( Conventions over Configuration )
       – The developers know where the files are
       – The tools know where to generate files
  • Example :                             1 Java package                                      1 web folder


   1 screen =
                                                                                          +
Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org )                      23
What is a Telosys project ?
  • Just a standard Java Web Application project
                                              src (server side)

                                              TelosysTools (+)                            deployment

                                              WebContent (client side)                                   .war



  • It can be organized for Maven, or not…
  • In Eclipse :
                                                                                           That’s all !
       1) Create a new "Web Dynamic project"                                               The project is ready
                                                                                           for development and
       2) Import the "Telosys Starter Kit“                                                 code generation
Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org )                           24
Demo
  • How to create a Telosys project …
     1) Create a Dynamic
        Web Project                                                                 2) Import the
                                                                                       Telosys starter kit




Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org )                      25
Demo (cont’d)
  • Test and initialize the Telosys project …
            3) Test the
               project
               ( run it )




           4) Define the
              conventions


Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org )   26
The Telosys Tools
The big picture
                                                                                                       Everything can be
                                                                                                       done in Eclipse


                                                                                   Editors   Wizards   Properties




                                Repository             Repository                Template
           Database                                    .dbrep                      .vm
           Meta-data            generator              ( XML )

                                                                       Code
                                                                                                           .java
                                                                       generator
                                                          Context                                          .jsp / .jspx

                                                                                                           .js
                                                                              Velocity

                                                                                                           other …



Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org )                                    28
The demo
  • Connection to the database
  • Repository generation
  • Repository customization
  • Basic objects generation (Bean, List, DAO, Conv.)
  • Screens generation (server side & client side)
  • Template customization
  • Links management
  • Beans generation for JPA & Validators
  • New specific template         See demo screenshots at
                                                                                          the end of this presentation
Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org )                                  29
Conclusion
Conclusion
  Database                              Repository                                        Tools   Initial code




                                                                                      and the project is
                                                                                      on the rails…


Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org )                      31
In the future …
  • Main goals in the 2012 roadmap
       – Repository
            • Extendable/unlimited information for
              each entity and each Java field
       – Screens design
            • Official release of the Screen Builder
              plugin (WYSIWYG)
                                                                                          Still a lot
       – Java Portals                                                                     of work to
            • JSR-168 portlet to embed
              screen maps in a portal page
                                                                                          improve
       – NoSQL
                                                                                          the rails …
            • DAO for GAE/BigTable & Cassandra
Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org )             32
Questions ?
Appendix
Framework features

   Screen Maps
                                                                                          Widgets TagLib
                                              DataSet
             Services
                          JavaScript framework
         Commons/util classes                SQL DAO
                                   Logging
           Authentication
          XML converters      File upload/download

                      Text/CSV files parser                                               Selectable/Sortable
            Internationalization                                                          beans lists
Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org )                     35
Telosys Screen Builder
     A visual tool to design the Telosys Screens
     ( beta version )




Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org )   36
Follow the project …
• Web site : http://www.telosys.org


•         LinkedIN
    http://www.linkedin.com/groups?gid=1340197

•         Twitter
    http://twitter.com/telosys

•         Viadeo (in french)
    http://www.viadeo.com/hu03/0024uydjnnwew6j/telosys
Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org )   37
The demo…
Demo
  • Use the database meta-data to generate the
    initial repository

             Database
                             Generation
                               rules


                        Repository
                        Generator




          Repository
          .dbrep
          ( XML )




Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org )   39
Demo (cont’d)
  • The generated repository is editable
    with an Eclipse plugin editor

                                                                                                  Database

                                                                                                 Java Classes




                                                                                                                updatable




                             Database                                          Java Attributes
                                                O/R Mapping




Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org )                                     40
Demo (cont’d)
  • Java fields :
       – Each Java field can have additional information
       – Useful for
            • JSP/TagLib user input validation
            • "Bean Validation " annotations ( JSR 303 )
              or "Hibernate Validators"




Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org )   41
Demo (cont’d)
  • Bulk generation




Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org )   42
Demo (cont’d)
  • Generator templates
       – The generator is based on "Velocity"
       – The templates ( ".vm" files ) can be modified in order
        to conform with each project requirements
             • coding style
             • comments
             • etc…                                                                       i.e. :
                                                                                          add/remove
                                                                                          serialization




Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org )                   43
Demo (cont’d)
  • Entities links
       – The foreign keys can be used to generate
        links between entities
       –Useful for JPA beans generation




Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org )   44
Demo (cont’d)
  • Generator project’s variables
       – Each project can
        define its own
        specific variables…


          … and use them
          in the templates
      #if ( $bean_jpa == "1" )
      $link.jpaAnnotations(4)
      #end




Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org )   45
Demo (cont’d)
  • Adding a new specific template
       – 1) create the new “.vm” file                                                                    vo_doc_html.vm

       – 2) add it in the “templates.cfg” file
           HTML documentation ;                    ${BEANNAME}.html ;                     doc/html ;   vo_doc_html.vm

              Title                                  File                                 Folder       Template

       –3) use it in the tool …




Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org )                                   46
Demo (cont’d)
  • Using wizards

          New …




Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org )   47
The end

More Related Content

More from Laurent Guérin

Telosys project booster Paris Open Source Summit 2019
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
 
Telosys tutorial - Code generation for a Python web application based on Bott...
Telosys tutorial - Code generation for a Python web application based on Bott...Telosys tutorial - Code generation for a Python web application based on Bott...
Telosys tutorial - Code generation for a Python web application based on Bott...Laurent Guérin
 
MQTT avec Mosquitto et Paho - DevFest Brest 2019
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
 
MQTT avec Mosquitto et Paho - Laurent Guerin - JUG Nantes Nov 2018
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
 
Meetup python-bottle-telosys-2018-lgu-v1.0
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
 
DevOps MeetUp NL - Docker (Oct 2014)
DevOps MeetUp NL - Docker (Oct 2014)DevOps MeetUp NL - Docker (Oct 2014)
DevOps MeetUp NL - Docker (Oct 2014)Laurent Guérin
 
Telosys tools jug-nantes-2014-v1.2
Telosys tools jug-nantes-2014-v1.2Telosys tools jug-nantes-2014-v1.2
Telosys tools jug-nantes-2014-v1.2Laurent Guérin
 
Genie logiciel eseo-v1.1-1spp
Genie logiciel eseo-v1.1-1sppGenie logiciel eseo-v1.1-1spp
Genie logiciel eseo-v1.1-1sppLaurent Guérin
 
Solutions Linux Développement Rapide Java
Solutions Linux Développement Rapide JavaSolutions Linux Développement Rapide Java
Solutions Linux Développement Rapide JavaLaurent Guérin
 

More from Laurent Guérin (9)

Telosys project booster Paris Open Source Summit 2019
Telosys project booster Paris Open Source Summit 2019Telosys project booster Paris Open Source Summit 2019
Telosys project booster Paris Open Source Summit 2019
 
Telosys tutorial - Code generation for a Python web application based on Bott...
Telosys tutorial - Code generation for a Python web application based on Bott...Telosys tutorial - Code generation for a Python web application based on Bott...
Telosys tutorial - Code generation for a Python web application based on Bott...
 
MQTT avec Mosquitto et Paho - DevFest Brest 2019
MQTT avec Mosquitto et Paho - DevFest Brest 2019MQTT avec Mosquitto et Paho - DevFest Brest 2019
MQTT avec Mosquitto et Paho - DevFest Brest 2019
 
MQTT avec Mosquitto et Paho - Laurent Guerin - JUG Nantes Nov 2018
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
 
Meetup python-bottle-telosys-2018-lgu-v1.0
Meetup python-bottle-telosys-2018-lgu-v1.0Meetup python-bottle-telosys-2018-lgu-v1.0
Meetup python-bottle-telosys-2018-lgu-v1.0
 
DevOps MeetUp NL - Docker (Oct 2014)
DevOps MeetUp NL - Docker (Oct 2014)DevOps MeetUp NL - Docker (Oct 2014)
DevOps MeetUp NL - Docker (Oct 2014)
 
Telosys tools jug-nantes-2014-v1.2
Telosys tools jug-nantes-2014-v1.2Telosys tools jug-nantes-2014-v1.2
Telosys tools jug-nantes-2014-v1.2
 
Genie logiciel eseo-v1.1-1spp
Genie logiciel eseo-v1.1-1sppGenie logiciel eseo-v1.1-1spp
Genie logiciel eseo-v1.1-1spp
 
Solutions Linux Développement Rapide Java
Solutions Linux Développement Rapide JavaSolutions Linux Développement Rapide Java
Solutions Linux Développement Rapide Java
 

Recently uploaded

Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusZilliz
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbuapidays
 

Recently uploaded (20)

Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 

Devoxx 2011 - Scaffolding with Telosys

  • 1. A pragmatic scaffolding approach to build Java Web Applications Laurent Guérin Telosys Project Leader Sogeti & OW2 Consortium
  • 2. Introduction Sogeti : Company Capgemini : Company belongs to : Plateform Laurent Guérin : Person Telosys : Project leads laurent.guerin@sogeti.com : IDE located in hosts OW2 : Consortium : License France : Country Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org ) 2
  • 3. Introduction OUTLINE : - Code generation - Telosys approach - The framework - The tools (demo) Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org ) 3
  • 5. Model Driven • "Model-First" approach ( MDD, MDA, … ) • Code generation from an existing model • "Model Driven" => You need a model ! • Model => substantial initial investment • Process : keep the model up to date ! MODEL Split ! XMI Service name +port 0..n ( XML ) Port Binding Port Type 1 +binding name name name Param 1 +type name StartWithExtensions +output 0..1 +operation 0..n +operation 0..n +input Input 0..1 +input BindingOperation Operation 0..1 Code name name 1 0..1 Output +output +message 1 +fault 0..n +fault 0..n Message Fault +message BindingFault name name 1 1 +part 0..n Part name TOOL Template Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org ) 5
  • 6. Scaffolding • "Database-first" approach Database • Very efficient • No customization between the database Metadata metadata and the generator TOOL • Not enough information … – Java field name Template – Java field type – Validation rules : min, max, regexp, … Code – Boolean storage values ( 1/0, "T"/"F", … ) – etc … • Cannot store/reuse further information Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org ) 6
  • 7. Wizards • Code generation without model / DB “Java Model” org.eclipse.jdt.core • IDE tool => Needs user inputs Workspace files I.D.E. • Can also use existing artefacts as input – Java class  Java class – WSDL file  Java classes • Efficient only for a few kinds of targets Code • Can only be considered as Bulk generation "development accelerators" Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org ) 7
  • 9. Telosys approach • What we want … – to be able to generate code quickly for entities management (like scaffolding) with a simple tool – to add and keep specific information about entities => we need a repository to store them (kind of model) • What we don’t want … – to spend a lot of time to build a model – to input further information for each generation • What we must have … – a database (“database first”) Metadata DB + – an IDE (Eclipse) that is the developer’s daily tool Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org ) 9
  • 10. Telosys approach • The 3 steps … Template Database updates customizes Metadata modify & add information Code Repository Code generator generator generates Repository (Lightweight updates model) 1 2 3 Use the Customize the Generate “Database-first” “lightweight model” the code approach to build a “lightweight model” Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org ) 10
  • 11. The tripod of success What a Method ( agile ) development project needs… Tools Framework ( code generation ) ( global & simple ) • The framework is self-sufficient to build a complete Web application ( "global" / "full stack" framework ) • The tools are provided as Eclipse plugins in order to make the programmer's life easier Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org ) 11
  • 12. Project’s philosophy • “Keep it simple and stupid” ( KISP ? ) – lightweight framework – small tools (easy to install & to use) • “Conform with the standards” – servlet/JSP/JSPX, JDBC, JPA, http, XML, … • “Remain open” – Open Source (hosted by OW2 consortium) – Open Format (lightweight model = XML) – Customizable templates  different targets : Telosys fwk + other Java Frameworks, Flex, PHP, … Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org ) 12
  • 14. The framework • Global framework “all in one“ • Only one jar (+ JDBC) => no "jar hell" ! • Designed for "data centric" web applications • Light (just needs a servlet container and a database) & based on simple concepts Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org ) 14
  • 15. The "global effect" One framework that covers all the application layers Authenti- cation Presentation Application Business Persistence Services Screen Java Beans Maps ( POJO ) DAO XML conv "VO" SQL JSP + taglib Screen AJAX Managers Framework Services Thin persistence Javascript layer Very simple objects Natively AJAX Commons, logging, I18N, … ( "Pure POJO" ) • “Global” means … less “glue”, less objects (less memory footprint), less configuration, … => Coherence & Efficiency • “Modular” (modules usable separately) Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org ) 15
  • 16. The "client-server" paradigm • Once the screen is loaded in the browser, it converses with the server via AJAX requests ( XML / http ) Client-side http Server-side <request screen-name="Employee" screen-id="0" action="get" > </request> Screen Manager Action <response screen-name="Employee" screen-id="0" action="get" > <return code="0" message="Ok" > </return> Framework JavaScript <data> <employee id="23" lastName="Wayne" firstName="John" manager="0" email="" /> </data> </response> Service Service http://myhost:8080/.../Add.svc?p1=2&p2=6 <response service-name="Add"> <return code="0" message="Ok" /> <values> <value result="8" /> </values> <data> </data> </response> Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org ) 16
  • 17. The "Data Objects" • VO Bean (POJO = “entity record”) Code • VO List (selectable/sortable list of POJO) generator • DataSet (grid of objects) Book .java BookDAO BookConv VO Bean .java .java Data Database XML XML Access <…> VO List Layer Book </ … > Table Con- BookList verters .java DataSet Parsers Files Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org ) 17
  • 18. The "Data Access Layer" • Why another persistence framework ? ORM : JPA (or Hibernate) … High level & "Object Oriented" Java objects Hides the complexity rule the persistence Sometimes misunderstood by the developers ( "lazy/eager" loading, cache effects, DB "attached/detached" entities, "owning side"/"inverse side" links, … ) new new Telosys DAL (based on DAO pattern) Intermediate level & "Record Oriented" Database records One Bean = One Record rule the persistence The developer keeps the control No links, no cache, no byte-code enhancement DB Very simple API : load, save, insert, update, exists, loadList, updateList, … new legacy JDBC API Both are useful, Low level You have the choice … Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org ) 18
  • 19. "Record Persistence" examples  A "record" = a bean (POJO)  Each bean is managed by a dedicated DAO EmployeeDAO dao = getDAO(); Employee employee = new Employee(); employee.setCode( "123" ); // primary key int r = dao.load(employee, db); The developer decides… if ( r > 0 ) { // if found . What to do // update employee.setFirstName("Bill"); . How to do it dao.update(employee, db); } . When to do it else { // create employee.setLastName("Wayne"); EmployeeList list = new EmployeeList(); employee.setFirstName("John"); ListQuery query = dao.createQuery(…); employee.setEmail("jwayne@cinema.com"); int count = dao.count(query, db); dao.insert(employee, db); dao.loadList(query, list, db); } dao.updateList(list, db); if (dao.exists(employee,db)){...} dao.delete(employee, db); db.commit(); db.rollback(); Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org ) 19
  • 20. Links or no links ? • You have the choice … • Links can be generated if an “object graph approach” is chosen (ie with JPA persistence) Bean @ManyToOne Code @OneToMany generator @ManyToMany @OneToOne • With a “record approach” : no need to manage links between beans, the framework uses “aggregations” to assemble required beans Code Bean generator Aggregation (composite) DAO Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org ) 20
  • 21. The screens Code generator request BookMgr BookProc ScreenMap .java .java response ScreenManager ScreenProcedure V C AJAX acts on … BookData .java Book (bean) M ScreenData AuthorList Book.jsp (aggregation ( or .jspx) 0 .. N objects) Shop (bean) Book.js DataSet Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org ) 21
  • 22. Screen view example JSP or JSPX, but no HTML ! <%@ taglib uri="/telosys/widgets" prefix="t" %> <t:screenbody> <t:label id="L_EmpId" x="40" y="60" txt="Employee Id : " cl="PK_field_label" /> <t:label id="L_LastName" x="40" y="100" txt="Last name : " /> <t:label id="L_FirstName" x="40" y="140" txt="First name : " /> <t:label id="L_Birthdate" x="40" y="180" txt="Birthdate : " /> <t:field x="200" y="60" id="EmpId" cl="PK_field" size="6" maxlength="6" /> <t:field x="200" y="100" id="LastName" size="30" maxlength="30" value="Aaaa" /> <t:button x="460" y="100" id="b1" txt="My button" onclick="b1_onClick();" /> <t:field x="200" y="140" id="FirstName" size="30" maxlength="30" value="Georges" /> <t:field x="200" y="180" id="Birthdate" size="10" maxlength="10" value="" type="Date" /> <t:radiogroup id="Contract" x="200" y="220"> <t:radioitem id="R_field61" x="0" y="0" value="1" txt="C.D.D. (1)" /> <t:radioitem id="R_field62" x="0" y="20" value="2" txt="C.D.I. (2)" /> </t:radiogroup > <t:checkbox id="Manager" x="340" y="220" value="1" valueoff="9" txt="Manager" /> </t:screenbody > Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org ) 22
  • 23. Conventions • "Framework" => "Frame" ! • "CoC" ( Conventions over Configuration ) – The developers know where the files are – The tools know where to generate files • Example : 1 Java package 1 web folder 1 screen = + Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org ) 23
  • 24. What is a Telosys project ? • Just a standard Java Web Application project src (server side) TelosysTools (+) deployment WebContent (client side) .war • It can be organized for Maven, or not… • In Eclipse : That’s all ! 1) Create a new "Web Dynamic project" The project is ready for development and 2) Import the "Telosys Starter Kit“ code generation Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org ) 24
  • 25. Demo • How to create a Telosys project … 1) Create a Dynamic Web Project 2) Import the Telosys starter kit Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org ) 25
  • 26. Demo (cont’d) • Test and initialize the Telosys project … 3) Test the project ( run it ) 4) Define the conventions Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org ) 26
  • 28. The big picture Everything can be done in Eclipse Editors Wizards Properties Repository Repository Template Database .dbrep .vm Meta-data generator ( XML ) Code .java generator Context .jsp / .jspx .js Velocity other … Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org ) 28
  • 29. The demo • Connection to the database • Repository generation • Repository customization • Basic objects generation (Bean, List, DAO, Conv.) • Screens generation (server side & client side) • Template customization • Links management • Beans generation for JPA & Validators • New specific template See demo screenshots at the end of this presentation Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org ) 29
  • 31. Conclusion Database Repository Tools Initial code and the project is on the rails… Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org ) 31
  • 32. In the future … • Main goals in the 2012 roadmap – Repository • Extendable/unlimited information for each entity and each Java field – Screens design • Official release of the Screen Builder plugin (WYSIWYG) Still a lot – Java Portals of work to • JSR-168 portlet to embed screen maps in a portal page improve – NoSQL the rails … • DAO for GAE/BigTable & Cassandra Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org ) 32
  • 35. Framework features Screen Maps Widgets TagLib DataSet Services JavaScript framework Commons/util classes SQL DAO Logging Authentication XML converters File upload/download Text/CSV files parser Selectable/Sortable Internationalization beans lists Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org ) 35
  • 36. Telosys Screen Builder A visual tool to design the Telosys Screens ( beta version ) Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org ) 36
  • 37. Follow the project … • Web site : http://www.telosys.org • LinkedIN http://www.linkedin.com/groups?gid=1340197 • Twitter http://twitter.com/telosys • Viadeo (in french) http://www.viadeo.com/hu03/0024uydjnnwew6j/telosys Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org ) 37
  • 39. Demo • Use the database meta-data to generate the initial repository Database Generation rules Repository Generator Repository .dbrep ( XML ) Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org ) 39
  • 40. Demo (cont’d) • The generated repository is editable with an Eclipse plugin editor Database Java Classes updatable Database Java Attributes O/R Mapping Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org ) 40
  • 41. Demo (cont’d) • Java fields : – Each Java field can have additional information – Useful for • JSP/TagLib user input validation • "Bean Validation " annotations ( JSR 303 ) or "Hibernate Validators" Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org ) 41
  • 42. Demo (cont’d) • Bulk generation Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org ) 42
  • 43. Demo (cont’d) • Generator templates – The generator is based on "Velocity" – The templates ( ".vm" files ) can be modified in order to conform with each project requirements • coding style • comments • etc… i.e. : add/remove serialization Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org ) 43
  • 44. Demo (cont’d) • Entities links – The foreign keys can be used to generate links between entities –Useful for JPA beans generation Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org ) 44
  • 45. Demo (cont’d) • Generator project’s variables – Each project can define its own specific variables… … and use them in the templates #if ( $bean_jpa == "1" ) $link.jpaAnnotations(4) #end Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org ) 45
  • 46. Demo (cont’d) • Adding a new specific template – 1) create the new “.vm” file vo_doc_html.vm – 2) add it in the “templates.cfg” file HTML documentation ; ${BEANNAME}.html ; doc/html ; vo_doc_html.vm Title File Folder Template –3) use it in the tool … Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org ) 46
  • 47. Demo (cont’d) • Using wizards New … Devoxx 2011 – Laurent Guérin – JAVA scaffolding with Telosys ( http://www.telosys.org ) 47