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

Recently uploaded

Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 

Recently uploaded (20)

Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

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