SlideShare a Scribd company logo
1 of 54
Download to read offline
Abstracting databases access
    in Titanium Mobile
       Xavier Lacot – September 2011
Hello


        My name is Xavier Lacot
         ■    I live in Paris
         ■    I work at Clever Age, as director of the Expertise Center
              (http://www.clever-age.com/)
         ■    Open Source convinced and contributor
         ■    Titanium enthusiast and developer since 2009
         ■    Web Frameworks expert
         ■    Vice Pr. of the French PHP Users Association (afup.org)
         ■    http://twitter.com/xavierlacot

CodeStrong - Abstracting databases access in Titanium Mobile              2
Xavier Lacot | September 2011
Summary


  1. Using databases in Titanium Mobile applications
  2. Who said "pain"?
  3. The ORM concept
  4. Various js ORMs available
        ■    Titanium Mobile compatibility chart
  5. A focus on joli.js
        ■    Main use
        ■    Joli API extension

CodeStrong - Abstracting databases access in Titanium Mobile         3
Xavier Lacot | September 2011
Using databases in Titanium Mobile applications


  ■    Titanium provides a complete Database API :
        ■    Titanium.Database
        ■    Titanium.Database.DB
        ■    Titanium.Database.ResultSet


  ■    Access to SQLite databases
  ■    The way to go when manipulating data in mobile
       applications!

CodeStrong - Abstracting databases access in Titanium Mobile                  4
Xavier Lacot | September 2011
Databases are very common in mobile
                                                                           applications

  ■    Traveling guides (non-connected mode);
  ■    News apps,
  ■    Todo lists,
  ■    Etc.




CodeStrong - Abstracting databases access in Titanium Mobile                          5
Xavier Lacot | September 2011
Using databases in Titanium Mobile applications


  // create a connection
  var db = Titanium.Database.open('database_name');

  // execute a SQL query
  var rows = db.execute(
     'SELECT short_url FROM urls WHERE long_url = ?',
     Longurl
  );

  // get a result
  if (rows.isValidRow() && rows.fieldByName('short_url')) {
    result = rows.fieldByName('short_url');
  }

  // close the resultset
  rows.close();

  // close the database connection
  db.close();



CodeStrong - Abstracting databases access in Titanium Mobile                  6
Xavier Lacot | September 2011
Using databases in Titanium Mobile applications


  ■    Some details to care to:
        ■    Never forget to close() resultsets, or:
               ■   you will get memory leaks;
               ■   The app will unexpectedly close
        ■    You will have to accept the mix of “view code” and
             “database code”... javascript and SQL in the same code
             pages...




CodeStrong - Abstracting databases access in Titanium Mobile                  7
Xavier Lacot | September 2011
Summary


  1. Using databases in Titanium Mobile applications
  2. Who said "pain"?
  3. The ORM concept
  4. Various js ORMs available
        ■    Titanium Mobile compatibility chart
  5. A focus on joli.js
        ■    Main use
        ■    Joli API extension

CodeStrong - Abstracting databases access in Titanium Mobile         8
Xavier Lacot | September 2011
Who said "pain"?


  ■    Titanium.Database is ok for a few requests
  ■    It is limited in large scale applications:
        ■    Imagine a 10 tables model, each with 20 fields
  ■    Some questions:
        ■    Why write SQL queries yourself?
        ■    How to ensure data consistency / related entries retrieval?
        ■    How to deal with database migrations in your app?
        ■    How to avoid writing again and again the same queries?


CodeStrong - Abstracting databases access in Titanium Mobile                  9
Xavier Lacot | September 2011
A pain-in-the-ass sample


  ■    Remove an item from an ordered list
        ■    Remove the item from the database
        ■    Update the other items positions

  // add delete event listener
  tableview.addEventListener('delete', function(e) {
    var db = Titanium.Database.open('database_name');

      // delete the item
      db.execute(
        'DELETE FROM short_url WHERE id = ?',
         e.row.children[0].text
      );




CodeStrong - Abstracting databases access in Titanium Mobile                         10
Xavier Lacot | September 2011
A pain-in-the-ass sample

     ...

     // update the other items positions
     var rows = db.execute('SELECT * FROM short_url ORDER BY position ASC');
     var position = 1;

     while (rows.isValidRow()) {
       db.execute(
          'UPDATE short_url SET position = ? WHERE id = ?',
          position,
          rows.fieldByName('id')
       );
       position++;
       rows.next();
     }

    // be a good boy
    rows.close();
    db.close();
  });



CodeStrong - Abstracting databases access in Titanium Mobile                          11
Xavier Lacot | September 2011
CodeStrong - Abstracting databases access in Titanium Mobile   12
Xavier Lacot | September 2011
A pain-in-the-ass sample


  ■    Wait oh wait
        ■    Our business-code is cluttered with database manipulation
             code
        ■    Why not simply write:

    // add delete event listener
    tableview.addEventListener('delete', function(e) {
       // assume short_url is an object which represents the short_url table
       short_url.get(e.row.children[0].text).remove();
    };




CodeStrong - Abstracting databases access in Titanium Mobile                          13
Xavier Lacot | September 2011
Just to convince you...


  ■    A todo-list application
        ■    Only display, count, get stats about the tasks of the
             currently selected category
        ■    Will you always write the «                       WHERE category_id = '12'   »
             condition?
        ■    A better idea:

       category.get(12).listArticles();
       category.get(12).countArticles();
       // etc




CodeStrong - Abstracting databases access in Titanium Mobile                                  14
Xavier Lacot | September 2011
Summary


  1. Using databases in Titanium Mobile applications
  2. Who said "pain"?
  3. The ORM concept
  4. Various js ORMs available
        ■    Titanium Mobile compatibility chart
  5. A focus on joli.js
        ■    Main use
        ■    Joli API extension

CodeStrong - Abstracting databases access in Titanium Mobile         15
Xavier Lacot | September 2011
What is an « ORM »?


  ■    Object-Relational Mapper
        ■    Data access and manipulation abstraction
        ■    Classes represent tables, objects represent their content

            table Human
                                                               // say Human is a mapping class
            id                 integer                         var john = new Human();
            lastname           text
                                                               john.set('lastname', 'Doe');
            firstname          text
                                                               john.set('firstname', 'John');
            city_id            integer
            born_at            timestamp                       // persist it
                                                               john.save();
            is_alive           boolean
            dead_at            timestamp


CodeStrong - Abstracting databases access in Titanium Mobile                                     16
Xavier Lacot | September 2011
Goals of an ORM


  ■    Manipulate records
        ■   Never create or delete a record manually
        ■   Use behaviors (timestampable, taggable, etc.)
        ■   Clean user entries
  ■    Execute queries
        ■   Abstract queries as objects
        ■   Pass it to several methods
  ■    Create your data model and manage it with
       migrations

CodeStrong - Abstracting databases access in Titanium Mobile                 17
Xavier Lacot | September 2011
Summary


  1. Using databases in Titanium Mobile applications
  2. Who said "pain"?
  3. The ORM concept
  4. Various js ORMs available
        ■    Titanium Mobile compatibility chart
  5. A focus on joli.js
        ■    Main use
        ■    Joli API extension

CodeStrong - Abstracting databases access in Titanium Mobile         18
Xavier Lacot | September 2011
ORMs in javascript


  ■    There are lots of javascript ORMs
        ■    Suited for various Database access APIs
               ■   Browsers
               ■   Node
               ■   Titanium
               ■   Etc.
        ■    Not every is convenient for Titanium
               ■   Leaks, incompatibility, not tested, etc.
               ■   Not using Titanium.database



CodeStrong - Abstracting databases access in Titanium Mobile                    19
Xavier Lacot | September 2011
Some of them, designed for Titanium


  ■    ActiveJS Titanium fork - https://github.com/sr3d/activejs-1584174
  ■    AppceleratorRecord - https://github.com/wibblz/AppceleratorRecord
  ■    JazzRecord - http://www.jazzrecord.org/
  ■    TiStore - https://github.com/jcfischer/TiStore
  ■    yORM - https://github.com/segun/yORM
  ■    Joli.js - https://github.com/xavierlacot/joli.js
  ■    Maybe others?



       … That's a nice list!

CodeStrong - Abstracting databases access in Titanium Mobile                          20
Xavier Lacot | September 2011
ORMs chart




CodeStrong - Abstracting databases access in Titanium Mobile            21
Xavier Lacot | September 2011
Summary


  1. Using databases in Titanium Mobile applications
  2. Who said "pain"?
  3. The ORM concept
  4. Various js ORMs available
        ■    Titanium Mobile compatibility chart
  5. A focus on joli.js
        ■    Main use
        ■    Joli API extension

CodeStrong - Abstracting databases access in Titanium Mobile         22
Xavier Lacot | September 2011
Joli.js


  ■    Why joli.js
        ■    I could not find what I was looking for in the other ORMs
        ■    I wanted an abstract query API
        ■    I wanted something short, simple and efficient
  ■    Some facts
        ■    Much inspired by JazzRecord (js) and Doctrine (PHP)
        ■    First release was written in 3 nights



CodeStrong - Abstracting databases access in Titanium Mobile          23
Xavier Lacot | September 2011
Features


  ■    Models container                                             Models container

  ■    Models declaration
                                                                    Models
  ■    Abstract query language
                                                                    Migrations
  ■    Record lifecycle management
  ■    Performance analysis                                         Records


  ■    Extensible                                                   Query engine




  ■    All this in a single ~850 lines file!                   joli.js Mirakl
                                                               Coeur Mirakl
                                                               Coeur




CodeStrong - Abstracting databases access in Titanium Mobile                           24
Xavier Lacot | September 2011
Models container


        Models container
                                              ■   Easy access to the model classes
                                                    ■   get()
        Models
                                                    ■   has()
        Migrations
                                                    ■   Etc.

        Records



        Query engine
                                              ■   Able to launch the migrations

  joli.js Mirakl
  Coeur Mirakl
  Coeur


CodeStrong - Abstracting databases access in Titanium Mobile                      25
Xavier Lacot | September 2011
Models


        Models container
                                              ■   Models represent the tables
                                                    ■   Model declaration
        Models
                                                    ■   Tables creation
        Migrations
                                                    ■   Mass-records management
                                                    ■   Fast selection methods
        Records                                         (aka « Magic getters »)

        Query engine




  joli.js Mirakl
  Coeur Mirakl
  Coeur


CodeStrong - Abstracting databases access in Titanium Mobile                          26
Xavier Lacot | September 2011
Declaring a model

  ■    Include joli.js
  ■    Declare a connection to your database:
      joli.connection = new joli.Connection('your_database_name');


  ■    Describe the model
      var city = new joli.model({
        table:    'city',
        columns: {
          id:                  'INTEGER',
          name:                'TEXT',
          description:         'TEXT'
        }
      });



  ■    call          joli.models.initialize();
CodeStrong - Abstracting databases access in Titanium Mobile                  27
Xavier Lacot | September 2011
Declaring a model

   ■    Several models? Put them in a bag!
       var models = (function() {
         var m = {};

         m.human = new joli.model({
           table:     'human',
           columns: {
             id:                  'INTEGER PRIMARY KEY AUTOINCREMENT',
             city_id:             'INTEGER',
             first_name:          'TEXT',
             last_name:           'TEXT'
           }
         });

         m.city = new joli.model({
           table:     'city',
           columns: {
             id:                  'INTEGER PRIMARY KEY AUTOINCREMENT',
             name:                'TEXT'
           }
         });

         return m;
       })();


CodeStrong - Abstracting databases access in Titanium Mobile                            28
Xavier Lacot | September 2011
table- and object- methods

 var human = new joli.model({
   table:     'human',
   columns: {
      ...
   },
   methods: {
      countIn: function(cityName) {
        // do something
   }
   },
   objectMethods: {
      moveTo: function(newCityName) {
        // do something
   }
   }
 });

 // use a table-method
 var habitantsCount = human.countIn('San Francisco');

 // use an object-method
 john.moveTo('Paris');

CodeStrong - Abstracting databases access in Titanium Mobile                           29
Xavier Lacot | September 2011
Mass records management

   var table = models.human;

   table.truncate();                                           // remove all humans
   table.deleteRecords([1, 7, 12]);                            // remove some records
   table.exists(118);                                          // test existance, based on "id"

   // count entities
   var allCount = table.count();
   var DoesCount = table.count({
     where: {
       'last_name = ?': 'Doe',
       'age >= ?': 21
     }
   });

   // get all the ones matching criterions
   var Does = table.all({
     where: {
        'last_name = ?': 'Doe',
        'age >= ?': 21
     },
     limit: 12
   });


CodeStrong - Abstracting databases access in Titanium Mobile                                      30
Xavier Lacot | September 2011
Magic getters

  ■    Goal: Have an easy way to select the records of
       one table matching a given criteria.
        ■    findOneById()
        ■    findOneBy()
        ■    findBy()

      var table = models.human;

      // returns all the inhabitants of the city n°12
      var parisians = table.findBy('city_id', 12);

      // returns one "human" record only (not sorted)
      var michel = table.findOneBy('first_name', 'Michel');

      // returns the human of id "118"
      var human = table.findOneById(118);

CodeStrong - Abstracting databases access in Titanium Mobile               31
Xavier Lacot | September 2011
Migrations


        Models container
                                              ■   Update the database layout
                                                  when updating the application
        Models
                                              ■   Allows to run other operations
                                                  (callbacks available)
        Migrations



        Records



        Query engine




  joli.js Mirakl
  Coeur Mirakl
  Coeur


CodeStrong - Abstracting databases access in Titanium Mobile                       32
Xavier Lacot | September 2011
Records


        Models container
                                              ■   Records are objects related to a
                                                  row in the database
        Models                                      ■   Record creation
                                                    ■   Record access
        Migrations
                                                    ■   Record update
        Records



        Query engine
                                              ■   Records can be used even
                                                  while not persisted
  joli.js Mirakl
  Coeur Mirakl
  Coeur


CodeStrong - Abstracting databases access in Titanium Mobile                     33
Xavier Lacot | September 2011
Create new records


   // first method
   var john = models.human.newRecord({
     first_name: 'John',
     last_name: 'Doe'
   });


   // second method
   var john = new joli.record(models.human);
   john.fromArray({
     first_name: 'John',
     last_name: 'Doe'
   });


   // third method
   var john = new joli.record(models.human);
   john.set('first_name', 'John');
   john.set('last_name', 'Doe');


CodeStrong - Abstracting databases access in Titanium Mobile                   34
Xavier Lacot | September 2011
Manipulate records


   // persist a record
   john.save();


   // destroy it
   john.destroy();


   // get a property
   var name = john.get('last_name');


   // export to an array
   var johnArray = john.toArray();
   var json = JSON.stringify(johnArray);
   // {"id":"110","lastname":"Doe","firstname":"John","company_name":"ACME"}




CodeStrong - Abstracting databases access in Titanium Mobile                   35
Xavier Lacot | September 2011
Query engine


        Models container
                                              ■   Abstract the way queries are
                                                  run against the database
        Models
                                              ■   Stop writing SQL
        Migrations                            ■   Use chained method calls
                                                  « à la jQuery »
        Records
                                              ■   Have hydratation facilities
        Query engine




  joli.js Mirakl
  Coeur Mirakl
  Coeur


CodeStrong - Abstracting databases access in Titanium Mobile                     36
Xavier Lacot | September 2011
Querying the model


  ■    No more SQL queries
  ■    Let's introduce an OOP querying model
        ■    Queries are objects
        ■    They can be                  execute()            'd

      // create the query object
      var q = new joli.query()
        .select()
        .from('human')
        .where('last_name = ?', 'Doe');

      // let's execute it
      var humans = q.execute();


CodeStrong - Abstracting databases access in Titanium Mobile                        37
Xavier Lacot | September 2011
A complete SQL-like vocabulary


  ■                              :
       Several methods for building queries:
        ■    count()                                              ■   set()
        ■    destroy()                                            ■   update()
        ■    from()                                               ■   values()
        ■    groupBy()                                            ■   where()
        ■    insertInto()                                         ■   whereIn()
        ■    join()
        ■    limit()
        ■    order()

CodeStrong - Abstracting databases access in Titanium Mobile                               38
Xavier Lacot | September 2011
Progressive query construction


     api.getActiveQuery = function(q) {
       if (!q) {                                               ■   Queries as objects are
         q = new joli.query()
            .from('news');                                         easy to handle
       }

       q.where('active = ?', true);                            ■   No matter the order in
       return q;
     };                                                            which you call the
     api.getLastPublished = function() {                           query methods!
       return api
         .getActiveQuery()
         .limit(1)
         .orderBy('created_at desc')
         .execute();
     }

     api.getPublished = function() {
       return api
         .getActiveQuery()
         .orderBy('created_at desc')
         .execute();
     }

CodeStrong - Abstracting databases access in Titanium Mobile                                   39
Xavier Lacot | September 2011
Let's talk about hydration


  ■   Calling execute() will:
        ■   Build the query string;
        ■   Send it to joli.Connection() for its execution;
        ■   And create a bunch of record objects (one per result).
  ■   This last step is called « hydration »
  ■   It can cost time. A lot.


  ■   Joli.js offers a way to hydrate plain arrays, not
      complete joli.js records.

CodeStrong - Abstracting databases access in Titanium Mobile                           40
Xavier Lacot | September 2011
Let's talk about hydratation


       var people = new joli.query()
         .select()
         .from('people')
         .execute();
       // people is an array of objects

       var people = new joli.query()
         .select()
         .from('people')
         .execute('array');
       // people is a simple plain array



   ■   An ORM as a cost, sure, but you can make it
       invisible to the user
   ■   Save you app, take care to the performances

CodeStrong - Abstracting databases access in Titanium Mobile                              41
Xavier Lacot | September 2011
Querying useful methods


   ■   getSqlQuery() returns the string that will be
       generated when executing the query

 var q = new joli.query()
   .select()
   .from('view_count')
   .where('nb_views between ? And ?', [1000, 2000]);

 var queryString = q.getSqlQuery();
 // select * from view_count where nb_views between "1000" and "2000"



   ■   All the queries go through
       joli.Connection.execute(). Possibility to log things
       here and see what is happening.
CodeStrong - Abstracting databases access in Titanium Mobile                        42
Xavier Lacot | September 2011
Unit tests


  ■    Joli.js is unit-tested using titanium-jasmine
        ■    90+ tests and growing
        ■    See https://github.com/xavierlacot/joli.js-demo for the test
             suite




CodeStrong - Abstracting databases access in Titanium Mobile            43
Xavier Lacot | September 2011
Summary


  1. Using databases in Titanium Mobile applications
  2. Who said "pain"?
  3. The ORM concept
  4. Various js ORMs available
        ■    Titanium Mobile compatibility chart
  5. A focus on joli.js
        ■    Main use
        ■    Joli API extension

CodeStrong - Abstracting databases access in Titanium Mobile         44
Xavier Lacot | September 2011
Joli API extension


  ■    We often need to synchronize data from/to the
       Web
  ■    Case sample : an online address book
        ■    We want the contacts to be available on the phone even
             when not connected
        ■    The contacts list must also be available online


  ■    Here comes joli.api.js, the little brother to joli.js


CodeStrong - Abstracting databases access in Titanium Mobile                   45
Xavier Lacot | September 2011
Joli API extension


  ■   joli.api.js is a wrapper to joli.js, which makes
      synchronization to REST web services easy


                                     joli.js
                                      joli.js                    REST
                                                                 Web
                               joli.api.js
                                joli.api.js                     Service

          Mobile application
          Mobile application




  ■   All CRUD operations are available : GET / POST /
      PUT / DELETE

CodeStrong - Abstracting databases access in Titanium Mobile                   46
Xavier Lacot | September 2011
Let's have a small demo


                                                      ■   A Titanium-powered
                                                          synchronized AddressBook
                                                      ■   Code will be available at
                                                          https://github.com/xavierlacot/joli.api.js-app-demo

                                                      ■    Uses REST APIs built in
                                                          PHP with the Symfony
                                                          framework




CodeStrong - Abstracting databases access in Titanium Mobile                                                    47
Xavier Lacot | September 2011
API synchronized model declaration
                                                                       joli.apimodel


     var people = new joli.apimodel({
       table: 'people',
       columns: {
          id:                 'INTEGER PRIMARY KEY AUTOINCREMENT',
          firstname:          'TEXT',
          lastname:           'TEXT',
          company_name:       'TEXT',
          email:              'TEXT',
          phone:              'TEXT',
          picture_url:        'TEXT'
       },
       updateTime:            86400,
       url:                   'http://local.example.com/api/people.json'
     });




                                                                   The REST endpoint url
CodeStrong - Abstracting databases access in Titanium Mobile                               48
Xavier Lacot | September 2011
Using the API


  ■    Minor changes compared to joli.js
                                                                The exact same method

      // selects from the database
      // if no result and the updateTime is gone, checks the API
      var peoples = joli.models.get('people').all({
        order: ['lastname asc', 'firstname asc']
      });


      // creates the record and saves it to the REST endpoint
      joli.models.get('people')
        .newRecord(values, true)
        .save();



                                                               Should the record be
CodeStrong - Abstracting databases access in Titanium Mobile
                                                                  synchronized?         49
Xavier Lacot | September 2011
This is Free and Open Source Software...


  ■    All the code is here :
        ■    joli.js - https://github.com/xavierlacot/joli.js
        ■    joli.api.js - https://github.com/xavierlacot/joli.api.js
        ■    joli.js test suite - https://github.com/xavierlacot/joli.js-demo
        ■    joli.api.js demo application -
             https://github.com/xavierlacot/joli.api.js-app-demo




CodeStrong - Abstracting databases access in Titanium Mobile                       50
Xavier Lacot | September 2011
Let's have a small demo

  ■    This app was built completely while I was in the
       plane. Less than 4 hours coding!
                                   // persist the values of the form
                                   button.addEventListener('click', function() {
                                     // extractValues() builds an associative array of the form values
                                    save(extractValues(container));
                                     win.close();
                                   });

                                   var save = function(values) {
                                      joli.models.get('people').newRecord(values, true).save();
                                   };




                                   [INFO]    POST request to url http://local.example.com/api/people.json
                                   [INFO]    Received from the service:
                                   [INFO]     {"id":"111","lastname":"Lacot","firstname":"Xavier", ...}
                                   [INFO]    1 new record(s), 0 record(s) updated.
                                   [DEBUG]   fire app event: joli.records.saved


CodeStrong - Abstracting databases access in Titanium Mobile                                          51
Xavier Lacot | September 2011
Roadmap and whishlist...

  ■    Joli.js:
        ■   Abstract the configuration
              ■   Logging enabled or not, default hydration model
              ■   Easy support for several databases
        ■   Improve migrations, add more unit tests
  ■    Joli.api.js
        ■   Support for all the HTTP methods
        ■   Make it possible to map the Data model to different REST
            services formats


       Keep all this fun, short and efficient
CodeStrong - Abstracting databases access in Titanium Mobile                         52
Xavier Lacot | September 2011
CodeStrong - Abstracting databases access in Titanium Mobile   53
Xavier Lacot | September 2011
2011 codestrong-abstracting-databases-access-in-titanium-mobile

More Related Content

Viewers also liked

Native Mobile Application Using Open Source
Native Mobile Application Using Open SourceNative Mobile Application Using Open Source
Native Mobile Application Using Open SourceAxway Appcelerator
 
Introducing Appcelerator's Open Mobile Marketplace
Introducing Appcelerator's Open Mobile MarketplaceIntroducing Appcelerator's Open Mobile Marketplace
Introducing Appcelerator's Open Mobile MarketplaceAxway Appcelerator
 
Service Oriented UI Architecture in the world of web, desktop, & mobile appli...
Service Oriented UI Architecture in the world of web, desktop, & mobile appli...Service Oriented UI Architecture in the world of web, desktop, & mobile appli...
Service Oriented UI Architecture in the world of web, desktop, & mobile appli...Axway Appcelerator
 

Viewers also liked (6)

iPhone and the Enterprise
iPhone and the EnterpriseiPhone and the Enterprise
iPhone and the Enterprise
 
Getting Started with Titanium
Getting Started with TitaniumGetting Started with Titanium
Getting Started with Titanium
 
Native Mobile Application Using Open Source
Native Mobile Application Using Open SourceNative Mobile Application Using Open Source
Native Mobile Application Using Open Source
 
Introducing Titanium
Introducing TitaniumIntroducing Titanium
Introducing Titanium
 
Introducing Appcelerator's Open Mobile Marketplace
Introducing Appcelerator's Open Mobile MarketplaceIntroducing Appcelerator's Open Mobile Marketplace
Introducing Appcelerator's Open Mobile Marketplace
 
Service Oriented UI Architecture in the world of web, desktop, & mobile appli...
Service Oriented UI Architecture in the world of web, desktop, & mobile appli...Service Oriented UI Architecture in the world of web, desktop, & mobile appli...
Service Oriented UI Architecture in the world of web, desktop, & mobile appli...
 

Similar to 2011 codestrong-abstracting-databases-access-in-titanium-mobile

Virtue Security - The Art of Mobile Security 2013
Virtue Security - The Art of Mobile Security 2013Virtue Security - The Art of Mobile Security 2013
Virtue Security - The Art of Mobile Security 2013Virtue Security
 
Enterprise Java: Just What Is It and the Risks, Threats, and Exposures It Poses
Enterprise Java: Just What Is It and the Risks, Threats, and Exposures It PosesEnterprise Java: Just What Is It and the Risks, Threats, and Exposures It Poses
Enterprise Java: Just What Is It and the Risks, Threats, and Exposures It PosesAlex Senkevitch
 
Ios fundamentals with ObjectiveC
Ios fundamentals with ObjectiveCIos fundamentals with ObjectiveC
Ios fundamentals with ObjectiveCMadusha Perera
 
Pentesting iOS Applications
Pentesting iOS ApplicationsPentesting iOS Applications
Pentesting iOS Applicationsjasonhaddix
 
iOS (Vulner)ability
iOS (Vulner)abilityiOS (Vulner)ability
iOS (Vulner)abilitySubho Halder
 
Giorgio Mandolini - Rapid application development con titanium appcelerator
Giorgio Mandolini - Rapid application development con titanium appceleratorGiorgio Mandolini - Rapid application development con titanium appcelerator
Giorgio Mandolini - Rapid application development con titanium appceleratorgdg-ancona
 
Rapid application development con titanium appcelerator
Rapid application development con titanium appceleratorRapid application development con titanium appcelerator
Rapid application development con titanium appceleratorGiorgio Mandolini
 
JDD2015: Sustainability Supporting Data Variability: Keeping Core Components ...
JDD2015: Sustainability Supporting Data Variability: Keeping Core Components ...JDD2015: Sustainability Supporting Data Variability: Keeping Core Components ...
JDD2015: Sustainability Supporting Data Variability: Keeping Core Components ...PROIDEA
 
JDD2015: Sustainability Supporting Data Variability: Keeping Core Components ...
JDD2015: Sustainability Supporting Data Variability: Keeping Core Components ...JDD2015: Sustainability Supporting Data Variability: Keeping Core Components ...
JDD2015: Sustainability Supporting Data Variability: Keeping Core Components ...PROIDEA
 
Programming on Windows 8.1: The New Stream and Storage Paradigm (Raffaele Ria...
Programming on Windows 8.1: The New Stream and Storage Paradigm (Raffaele Ria...Programming on Windows 8.1: The New Stream and Storage Paradigm (Raffaele Ria...
Programming on Windows 8.1: The New Stream and Storage Paradigm (Raffaele Ria...ITCamp
 
iOS application (in)security
iOS application (in)securityiOS application (in)security
iOS application (in)securityiphonepentest
 
Mistral and StackStorm
Mistral and StackStormMistral and StackStorm
Mistral and StackStormDmitri Zimine
 
Entity Framework V1 and V2
Entity Framework V1 and V2Entity Framework V1 and V2
Entity Framework V1 and V2ukdpe
 
iOS Client Side Analysis
iOS Client Side AnalysisiOS Client Side Analysis
iOS Client Side AnalysisAadarsh N
 
Breaking the Laws of Robotics: Attacking Industrial Robots
Breaking the Laws of Robotics: Attacking Industrial RobotsBreaking the Laws of Robotics: Attacking Industrial Robots
Breaking the Laws of Robotics: Attacking Industrial RobotsSpeck&Tech
 
Rental Cars and Industrialized Learning to Rank with Sean Downes
Rental Cars and Industrialized Learning to Rank with Sean DownesRental Cars and Industrialized Learning to Rank with Sean Downes
Rental Cars and Industrialized Learning to Rank with Sean DownesDatabricks
 
Introduction to MonoTouch and Monodroid/Mono for Android
Introduction to MonoTouch and Monodroid/Mono for AndroidIntroduction to MonoTouch and Monodroid/Mono for Android
Introduction to MonoTouch and Monodroid/Mono for AndroidChris Hardy
 

Similar to 2011 codestrong-abstracting-databases-access-in-titanium-mobile (20)

Virtue Security - The Art of Mobile Security 2013
Virtue Security - The Art of Mobile Security 2013Virtue Security - The Art of Mobile Security 2013
Virtue Security - The Art of Mobile Security 2013
 
Workshop slides
Workshop slidesWorkshop slides
Workshop slides
 
Enterprise Java: Just What Is It and the Risks, Threats, and Exposures It Poses
Enterprise Java: Just What Is It and the Risks, Threats, and Exposures It PosesEnterprise Java: Just What Is It and the Risks, Threats, and Exposures It Poses
Enterprise Java: Just What Is It and the Risks, Threats, and Exposures It Poses
 
Ios fundamentals with ObjectiveC
Ios fundamentals with ObjectiveCIos fundamentals with ObjectiveC
Ios fundamentals with ObjectiveC
 
iphone presentation
iphone presentationiphone presentation
iphone presentation
 
Pentesting iOS Applications
Pentesting iOS ApplicationsPentesting iOS Applications
Pentesting iOS Applications
 
iOS (Vulner)ability
iOS (Vulner)abilityiOS (Vulner)ability
iOS (Vulner)ability
 
Giorgio Mandolini - Rapid application development con titanium appcelerator
Giorgio Mandolini - Rapid application development con titanium appceleratorGiorgio Mandolini - Rapid application development con titanium appcelerator
Giorgio Mandolini - Rapid application development con titanium appcelerator
 
Rapid application development con titanium appcelerator
Rapid application development con titanium appceleratorRapid application development con titanium appcelerator
Rapid application development con titanium appcelerator
 
JDD2015: Sustainability Supporting Data Variability: Keeping Core Components ...
JDD2015: Sustainability Supporting Data Variability: Keeping Core Components ...JDD2015: Sustainability Supporting Data Variability: Keeping Core Components ...
JDD2015: Sustainability Supporting Data Variability: Keeping Core Components ...
 
JDD2015: Sustainability Supporting Data Variability: Keeping Core Components ...
JDD2015: Sustainability Supporting Data Variability: Keeping Core Components ...JDD2015: Sustainability Supporting Data Variability: Keeping Core Components ...
JDD2015: Sustainability Supporting Data Variability: Keeping Core Components ...
 
Programming on Windows 8.1: The New Stream and Storage Paradigm (Raffaele Ria...
Programming on Windows 8.1: The New Stream and Storage Paradigm (Raffaele Ria...Programming on Windows 8.1: The New Stream and Storage Paradigm (Raffaele Ria...
Programming on Windows 8.1: The New Stream and Storage Paradigm (Raffaele Ria...
 
iOS application (in)security
iOS application (in)securityiOS application (in)security
iOS application (in)security
 
Mistral and StackStorm
Mistral and StackStormMistral and StackStorm
Mistral and StackStorm
 
Entity Framework V1 and V2
Entity Framework V1 and V2Entity Framework V1 and V2
Entity Framework V1 and V2
 
iOS Client Side Analysis
iOS Client Side AnalysisiOS Client Side Analysis
iOS Client Side Analysis
 
Breaking the Laws of Robotics: Attacking Industrial Robots
Breaking the Laws of Robotics: Attacking Industrial RobotsBreaking the Laws of Robotics: Attacking Industrial Robots
Breaking the Laws of Robotics: Attacking Industrial Robots
 
Rental Cars and Industrialized Learning to Rank with Sean Downes
Rental Cars and Industrialized Learning to Rank with Sean DownesRental Cars and Industrialized Learning to Rank with Sean Downes
Rental Cars and Industrialized Learning to Rank with Sean Downes
 
Introduction to MonoTouch and Monodroid/Mono for Android
Introduction to MonoTouch and Monodroid/Mono for AndroidIntroduction to MonoTouch and Monodroid/Mono for Android
Introduction to MonoTouch and Monodroid/Mono for Android
 
Getting started with entity framework
Getting started with entity framework Getting started with entity framework
Getting started with entity framework
 

More from Axway Appcelerator

Axway Appcelerator - Titanium SDK 6.1.0 - Status, Releases & Roadmap
Axway Appcelerator - Titanium SDK 6.1.0 - Status, Releases & RoadmapAxway Appcelerator - Titanium SDK 6.1.0 - Status, Releases & Roadmap
Axway Appcelerator - Titanium SDK 6.1.0 - Status, Releases & RoadmapAxway Appcelerator
 
2014 Dublin Web Summit by Jeff Haynie
2014 Dublin Web Summit by Jeff Haynie2014 Dublin Web Summit by Jeff Haynie
2014 Dublin Web Summit by Jeff HaynieAxway Appcelerator
 
Stop Debating, Start Measuring
Stop Debating, Start MeasuringStop Debating, Start Measuring
Stop Debating, Start MeasuringAxway Appcelerator
 
Mobile & The New Experience Economy (And What it Means for IT)
Mobile & The New Experience Economy  (And What it Means for IT)Mobile & The New Experience Economy  (And What it Means for IT)
Mobile & The New Experience Economy (And What it Means for IT)Axway Appcelerator
 
Apps, APIs & Analytics: What "Mobile First" Really Means
Apps, APIs & Analytics: What "Mobile First" Really MeansApps, APIs & Analytics: What "Mobile First" Really Means
Apps, APIs & Analytics: What "Mobile First" Really MeansAxway Appcelerator
 
Appcelerator Presentation Template
Appcelerator Presentation TemplateAppcelerator Presentation Template
Appcelerator Presentation TemplateAxway Appcelerator
 
Codestrong 2012 keynote jonathan rende, appcelerator's vp of products
Codestrong 2012 keynote   jonathan rende, appcelerator's vp of productsCodestrong 2012 keynote   jonathan rende, appcelerator's vp of products
Codestrong 2012 keynote jonathan rende, appcelerator's vp of productsAxway Appcelerator
 
Codestrong 2012 keynote jeff haynie, appcelerator's ceo
Codestrong 2012 keynote   jeff haynie, appcelerator's ceoCodestrong 2012 keynote   jeff haynie, appcelerator's ceo
Codestrong 2012 keynote jeff haynie, appcelerator's ceoAxway Appcelerator
 
Codestrong 2012 keynote how to build a top ten app
Codestrong 2012 keynote   how to build a top ten appCodestrong 2012 keynote   how to build a top ten app
Codestrong 2012 keynote how to build a top ten appAxway Appcelerator
 
Codestrong 2012 breakout session at&t api platform and trends
Codestrong 2012 breakout session  at&t api platform and trendsCodestrong 2012 breakout session  at&t api platform and trends
Codestrong 2012 breakout session at&t api platform and trendsAxway Appcelerator
 
Codestrong 2012 breakout session what's new in titanium studio
Codestrong 2012 breakout session   what's new in titanium studioCodestrong 2012 breakout session   what's new in titanium studio
Codestrong 2012 breakout session what's new in titanium studioAxway Appcelerator
 
Codestrong 2012 breakout session using appcelerator cloud services in your ...
Codestrong 2012 breakout session   using appcelerator cloud services in your ...Codestrong 2012 breakout session   using appcelerator cloud services in your ...
Codestrong 2012 breakout session using appcelerator cloud services in your ...Axway Appcelerator
 
Codestrong 2012 breakout session the role of cloud services in your next ge...
Codestrong 2012 breakout session   the role of cloud services in your next ge...Codestrong 2012 breakout session   the role of cloud services in your next ge...
Codestrong 2012 breakout session the role of cloud services in your next ge...Axway Appcelerator
 
Codestrong 2012 breakout session new device platform support for titanium
Codestrong 2012 breakout session   new device platform support for titaniumCodestrong 2012 breakout session   new device platform support for titanium
Codestrong 2012 breakout session new device platform support for titaniumAxway Appcelerator
 
Codestrong 2012 breakout session mobile platform and infrastructure
Codestrong 2012 breakout session   mobile platform and infrastructureCodestrong 2012 breakout session   mobile platform and infrastructure
Codestrong 2012 breakout session mobile platform and infrastructureAxway Appcelerator
 
Codestrong 2012 breakout session making money on appcelerator's marketplace
Codestrong 2012 breakout session   making money on appcelerator's marketplaceCodestrong 2012 breakout session   making money on appcelerator's marketplace
Codestrong 2012 breakout session making money on appcelerator's marketplaceAxway Appcelerator
 
Codestrong 2012 breakout session live multi-platform testing
Codestrong 2012 breakout session   live multi-platform testingCodestrong 2012 breakout session   live multi-platform testing
Codestrong 2012 breakout session live multi-platform testingAxway Appcelerator
 
Codestrong 2012 breakout session leveraging titanium as part of your mobile...
Codestrong 2012 breakout session   leveraging titanium as part of your mobile...Codestrong 2012 breakout session   leveraging titanium as part of your mobile...
Codestrong 2012 breakout session leveraging titanium as part of your mobile...Axway Appcelerator
 
Codestrong 2012 breakout session i os internals and best practices
Codestrong 2012 breakout session   i os internals and best practicesCodestrong 2012 breakout session   i os internals and best practices
Codestrong 2012 breakout session i os internals and best practicesAxway Appcelerator
 

More from Axway Appcelerator (20)

Axway Appcelerator - Titanium SDK 6.1.0 - Status, Releases & Roadmap
Axway Appcelerator - Titanium SDK 6.1.0 - Status, Releases & RoadmapAxway Appcelerator - Titanium SDK 6.1.0 - Status, Releases & Roadmap
Axway Appcelerator - Titanium SDK 6.1.0 - Status, Releases & Roadmap
 
2014 Dublin Web Summit by Jeff Haynie
2014 Dublin Web Summit by Jeff Haynie2014 Dublin Web Summit by Jeff Haynie
2014 Dublin Web Summit by Jeff Haynie
 
Making the Mobile Mind Shift
Making the Mobile Mind ShiftMaking the Mobile Mind Shift
Making the Mobile Mind Shift
 
Stop Debating, Start Measuring
Stop Debating, Start MeasuringStop Debating, Start Measuring
Stop Debating, Start Measuring
 
Mobile & The New Experience Economy (And What it Means for IT)
Mobile & The New Experience Economy  (And What it Means for IT)Mobile & The New Experience Economy  (And What it Means for IT)
Mobile & The New Experience Economy (And What it Means for IT)
 
Apps, APIs & Analytics: What "Mobile First" Really Means
Apps, APIs & Analytics: What "Mobile First" Really MeansApps, APIs & Analytics: What "Mobile First" Really Means
Apps, APIs & Analytics: What "Mobile First" Really Means
 
Appcelerator Presentation Template
Appcelerator Presentation TemplateAppcelerator Presentation Template
Appcelerator Presentation Template
 
Codestrong 2012 keynote jonathan rende, appcelerator's vp of products
Codestrong 2012 keynote   jonathan rende, appcelerator's vp of productsCodestrong 2012 keynote   jonathan rende, appcelerator's vp of products
Codestrong 2012 keynote jonathan rende, appcelerator's vp of products
 
Codestrong 2012 keynote jeff haynie, appcelerator's ceo
Codestrong 2012 keynote   jeff haynie, appcelerator's ceoCodestrong 2012 keynote   jeff haynie, appcelerator's ceo
Codestrong 2012 keynote jeff haynie, appcelerator's ceo
 
Codestrong 2012 keynote how to build a top ten app
Codestrong 2012 keynote   how to build a top ten appCodestrong 2012 keynote   how to build a top ten app
Codestrong 2012 keynote how to build a top ten app
 
Codestrong 2012 breakout session at&t api platform and trends
Codestrong 2012 breakout session  at&t api platform and trendsCodestrong 2012 breakout session  at&t api platform and trends
Codestrong 2012 breakout session at&t api platform and trends
 
Codestrong 2012 breakout session what's new in titanium studio
Codestrong 2012 breakout session   what's new in titanium studioCodestrong 2012 breakout session   what's new in titanium studio
Codestrong 2012 breakout session what's new in titanium studio
 
Codestrong 2012 breakout session using appcelerator cloud services in your ...
Codestrong 2012 breakout session   using appcelerator cloud services in your ...Codestrong 2012 breakout session   using appcelerator cloud services in your ...
Codestrong 2012 breakout session using appcelerator cloud services in your ...
 
Codestrong 2012 breakout session the role of cloud services in your next ge...
Codestrong 2012 breakout session   the role of cloud services in your next ge...Codestrong 2012 breakout session   the role of cloud services in your next ge...
Codestrong 2012 breakout session the role of cloud services in your next ge...
 
Codestrong 2012 breakout session new device platform support for titanium
Codestrong 2012 breakout session   new device platform support for titaniumCodestrong 2012 breakout session   new device platform support for titanium
Codestrong 2012 breakout session new device platform support for titanium
 
Codestrong 2012 breakout session mobile platform and infrastructure
Codestrong 2012 breakout session   mobile platform and infrastructureCodestrong 2012 breakout session   mobile platform and infrastructure
Codestrong 2012 breakout session mobile platform and infrastructure
 
Codestrong 2012 breakout session making money on appcelerator's marketplace
Codestrong 2012 breakout session   making money on appcelerator's marketplaceCodestrong 2012 breakout session   making money on appcelerator's marketplace
Codestrong 2012 breakout session making money on appcelerator's marketplace
 
Codestrong 2012 breakout session live multi-platform testing
Codestrong 2012 breakout session   live multi-platform testingCodestrong 2012 breakout session   live multi-platform testing
Codestrong 2012 breakout session live multi-platform testing
 
Codestrong 2012 breakout session leveraging titanium as part of your mobile...
Codestrong 2012 breakout session   leveraging titanium as part of your mobile...Codestrong 2012 breakout session   leveraging titanium as part of your mobile...
Codestrong 2012 breakout session leveraging titanium as part of your mobile...
 
Codestrong 2012 breakout session i os internals and best practices
Codestrong 2012 breakout session   i os internals and best practicesCodestrong 2012 breakout session   i os internals and best practices
Codestrong 2012 breakout session i os internals and best practices
 

Recently uploaded

Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
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
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 

Recently uploaded (20)

Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
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
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 

2011 codestrong-abstracting-databases-access-in-titanium-mobile

  • 1. Abstracting databases access in Titanium Mobile Xavier Lacot – September 2011
  • 2. Hello My name is Xavier Lacot ■ I live in Paris ■ I work at Clever Age, as director of the Expertise Center (http://www.clever-age.com/) ■ Open Source convinced and contributor ■ Titanium enthusiast and developer since 2009 ■ Web Frameworks expert ■ Vice Pr. of the French PHP Users Association (afup.org) ■ http://twitter.com/xavierlacot CodeStrong - Abstracting databases access in Titanium Mobile 2 Xavier Lacot | September 2011
  • 3. Summary 1. Using databases in Titanium Mobile applications 2. Who said "pain"? 3. The ORM concept 4. Various js ORMs available ■ Titanium Mobile compatibility chart 5. A focus on joli.js ■ Main use ■ Joli API extension CodeStrong - Abstracting databases access in Titanium Mobile 3 Xavier Lacot | September 2011
  • 4. Using databases in Titanium Mobile applications ■ Titanium provides a complete Database API : ■ Titanium.Database ■ Titanium.Database.DB ■ Titanium.Database.ResultSet ■ Access to SQLite databases ■ The way to go when manipulating data in mobile applications! CodeStrong - Abstracting databases access in Titanium Mobile 4 Xavier Lacot | September 2011
  • 5. Databases are very common in mobile applications ■ Traveling guides (non-connected mode); ■ News apps, ■ Todo lists, ■ Etc. CodeStrong - Abstracting databases access in Titanium Mobile 5 Xavier Lacot | September 2011
  • 6. Using databases in Titanium Mobile applications // create a connection var db = Titanium.Database.open('database_name'); // execute a SQL query var rows = db.execute( 'SELECT short_url FROM urls WHERE long_url = ?', Longurl ); // get a result if (rows.isValidRow() && rows.fieldByName('short_url')) { result = rows.fieldByName('short_url'); } // close the resultset rows.close(); // close the database connection db.close(); CodeStrong - Abstracting databases access in Titanium Mobile 6 Xavier Lacot | September 2011
  • 7. Using databases in Titanium Mobile applications ■ Some details to care to: ■ Never forget to close() resultsets, or: ■ you will get memory leaks; ■ The app will unexpectedly close ■ You will have to accept the mix of “view code” and “database code”... javascript and SQL in the same code pages... CodeStrong - Abstracting databases access in Titanium Mobile 7 Xavier Lacot | September 2011
  • 8. Summary 1. Using databases in Titanium Mobile applications 2. Who said "pain"? 3. The ORM concept 4. Various js ORMs available ■ Titanium Mobile compatibility chart 5. A focus on joli.js ■ Main use ■ Joli API extension CodeStrong - Abstracting databases access in Titanium Mobile 8 Xavier Lacot | September 2011
  • 9. Who said "pain"? ■ Titanium.Database is ok for a few requests ■ It is limited in large scale applications: ■ Imagine a 10 tables model, each with 20 fields ■ Some questions: ■ Why write SQL queries yourself? ■ How to ensure data consistency / related entries retrieval? ■ How to deal with database migrations in your app? ■ How to avoid writing again and again the same queries? CodeStrong - Abstracting databases access in Titanium Mobile 9 Xavier Lacot | September 2011
  • 10. A pain-in-the-ass sample ■ Remove an item from an ordered list ■ Remove the item from the database ■ Update the other items positions // add delete event listener tableview.addEventListener('delete', function(e) { var db = Titanium.Database.open('database_name'); // delete the item db.execute( 'DELETE FROM short_url WHERE id = ?', e.row.children[0].text ); CodeStrong - Abstracting databases access in Titanium Mobile 10 Xavier Lacot | September 2011
  • 11. A pain-in-the-ass sample ... // update the other items positions var rows = db.execute('SELECT * FROM short_url ORDER BY position ASC'); var position = 1; while (rows.isValidRow()) { db.execute( 'UPDATE short_url SET position = ? WHERE id = ?', position, rows.fieldByName('id') ); position++; rows.next(); } // be a good boy rows.close(); db.close(); }); CodeStrong - Abstracting databases access in Titanium Mobile 11 Xavier Lacot | September 2011
  • 12. CodeStrong - Abstracting databases access in Titanium Mobile 12 Xavier Lacot | September 2011
  • 13. A pain-in-the-ass sample ■ Wait oh wait ■ Our business-code is cluttered with database manipulation code ■ Why not simply write: // add delete event listener tableview.addEventListener('delete', function(e) { // assume short_url is an object which represents the short_url table short_url.get(e.row.children[0].text).remove(); }; CodeStrong - Abstracting databases access in Titanium Mobile 13 Xavier Lacot | September 2011
  • 14. Just to convince you... ■ A todo-list application ■ Only display, count, get stats about the tasks of the currently selected category ■ Will you always write the « WHERE category_id = '12' » condition? ■ A better idea: category.get(12).listArticles(); category.get(12).countArticles(); // etc CodeStrong - Abstracting databases access in Titanium Mobile 14 Xavier Lacot | September 2011
  • 15. Summary 1. Using databases in Titanium Mobile applications 2. Who said "pain"? 3. The ORM concept 4. Various js ORMs available ■ Titanium Mobile compatibility chart 5. A focus on joli.js ■ Main use ■ Joli API extension CodeStrong - Abstracting databases access in Titanium Mobile 15 Xavier Lacot | September 2011
  • 16. What is an « ORM »? ■ Object-Relational Mapper ■ Data access and manipulation abstraction ■ Classes represent tables, objects represent their content table Human // say Human is a mapping class id integer var john = new Human(); lastname text john.set('lastname', 'Doe'); firstname text john.set('firstname', 'John'); city_id integer born_at timestamp // persist it john.save(); is_alive boolean dead_at timestamp CodeStrong - Abstracting databases access in Titanium Mobile 16 Xavier Lacot | September 2011
  • 17. Goals of an ORM ■ Manipulate records ■ Never create or delete a record manually ■ Use behaviors (timestampable, taggable, etc.) ■ Clean user entries ■ Execute queries ■ Abstract queries as objects ■ Pass it to several methods ■ Create your data model and manage it with migrations CodeStrong - Abstracting databases access in Titanium Mobile 17 Xavier Lacot | September 2011
  • 18. Summary 1. Using databases in Titanium Mobile applications 2. Who said "pain"? 3. The ORM concept 4. Various js ORMs available ■ Titanium Mobile compatibility chart 5. A focus on joli.js ■ Main use ■ Joli API extension CodeStrong - Abstracting databases access in Titanium Mobile 18 Xavier Lacot | September 2011
  • 19. ORMs in javascript ■ There are lots of javascript ORMs ■ Suited for various Database access APIs ■ Browsers ■ Node ■ Titanium ■ Etc. ■ Not every is convenient for Titanium ■ Leaks, incompatibility, not tested, etc. ■ Not using Titanium.database CodeStrong - Abstracting databases access in Titanium Mobile 19 Xavier Lacot | September 2011
  • 20. Some of them, designed for Titanium ■ ActiveJS Titanium fork - https://github.com/sr3d/activejs-1584174 ■ AppceleratorRecord - https://github.com/wibblz/AppceleratorRecord ■ JazzRecord - http://www.jazzrecord.org/ ■ TiStore - https://github.com/jcfischer/TiStore ■ yORM - https://github.com/segun/yORM ■ Joli.js - https://github.com/xavierlacot/joli.js ■ Maybe others? … That's a nice list! CodeStrong - Abstracting databases access in Titanium Mobile 20 Xavier Lacot | September 2011
  • 21. ORMs chart CodeStrong - Abstracting databases access in Titanium Mobile 21 Xavier Lacot | September 2011
  • 22. Summary 1. Using databases in Titanium Mobile applications 2. Who said "pain"? 3. The ORM concept 4. Various js ORMs available ■ Titanium Mobile compatibility chart 5. A focus on joli.js ■ Main use ■ Joli API extension CodeStrong - Abstracting databases access in Titanium Mobile 22 Xavier Lacot | September 2011
  • 23. Joli.js ■ Why joli.js ■ I could not find what I was looking for in the other ORMs ■ I wanted an abstract query API ■ I wanted something short, simple and efficient ■ Some facts ■ Much inspired by JazzRecord (js) and Doctrine (PHP) ■ First release was written in 3 nights CodeStrong - Abstracting databases access in Titanium Mobile 23 Xavier Lacot | September 2011
  • 24. Features ■ Models container Models container ■ Models declaration Models ■ Abstract query language Migrations ■ Record lifecycle management ■ Performance analysis Records ■ Extensible Query engine ■ All this in a single ~850 lines file! joli.js Mirakl Coeur Mirakl Coeur CodeStrong - Abstracting databases access in Titanium Mobile 24 Xavier Lacot | September 2011
  • 25. Models container Models container ■ Easy access to the model classes ■ get() Models ■ has() Migrations ■ Etc. Records Query engine ■ Able to launch the migrations joli.js Mirakl Coeur Mirakl Coeur CodeStrong - Abstracting databases access in Titanium Mobile 25 Xavier Lacot | September 2011
  • 26. Models Models container ■ Models represent the tables ■ Model declaration Models ■ Tables creation Migrations ■ Mass-records management ■ Fast selection methods Records (aka « Magic getters ») Query engine joli.js Mirakl Coeur Mirakl Coeur CodeStrong - Abstracting databases access in Titanium Mobile 26 Xavier Lacot | September 2011
  • 27. Declaring a model ■ Include joli.js ■ Declare a connection to your database: joli.connection = new joli.Connection('your_database_name'); ■ Describe the model var city = new joli.model({ table: 'city', columns: { id: 'INTEGER', name: 'TEXT', description: 'TEXT' } }); ■ call joli.models.initialize(); CodeStrong - Abstracting databases access in Titanium Mobile 27 Xavier Lacot | September 2011
  • 28. Declaring a model ■ Several models? Put them in a bag! var models = (function() { var m = {}; m.human = new joli.model({ table: 'human', columns: { id: 'INTEGER PRIMARY KEY AUTOINCREMENT', city_id: 'INTEGER', first_name: 'TEXT', last_name: 'TEXT' } }); m.city = new joli.model({ table: 'city', columns: { id: 'INTEGER PRIMARY KEY AUTOINCREMENT', name: 'TEXT' } }); return m; })(); CodeStrong - Abstracting databases access in Titanium Mobile 28 Xavier Lacot | September 2011
  • 29. table- and object- methods var human = new joli.model({ table: 'human', columns: { ... }, methods: { countIn: function(cityName) { // do something } }, objectMethods: { moveTo: function(newCityName) { // do something } } }); // use a table-method var habitantsCount = human.countIn('San Francisco'); // use an object-method john.moveTo('Paris'); CodeStrong - Abstracting databases access in Titanium Mobile 29 Xavier Lacot | September 2011
  • 30. Mass records management var table = models.human; table.truncate(); // remove all humans table.deleteRecords([1, 7, 12]); // remove some records table.exists(118); // test existance, based on "id" // count entities var allCount = table.count(); var DoesCount = table.count({ where: { 'last_name = ?': 'Doe', 'age >= ?': 21 } }); // get all the ones matching criterions var Does = table.all({ where: { 'last_name = ?': 'Doe', 'age >= ?': 21 }, limit: 12 }); CodeStrong - Abstracting databases access in Titanium Mobile 30 Xavier Lacot | September 2011
  • 31. Magic getters ■ Goal: Have an easy way to select the records of one table matching a given criteria. ■ findOneById() ■ findOneBy() ■ findBy() var table = models.human; // returns all the inhabitants of the city n°12 var parisians = table.findBy('city_id', 12); // returns one "human" record only (not sorted) var michel = table.findOneBy('first_name', 'Michel'); // returns the human of id "118" var human = table.findOneById(118); CodeStrong - Abstracting databases access in Titanium Mobile 31 Xavier Lacot | September 2011
  • 32. Migrations Models container ■ Update the database layout when updating the application Models ■ Allows to run other operations (callbacks available) Migrations Records Query engine joli.js Mirakl Coeur Mirakl Coeur CodeStrong - Abstracting databases access in Titanium Mobile 32 Xavier Lacot | September 2011
  • 33. Records Models container ■ Records are objects related to a row in the database Models ■ Record creation ■ Record access Migrations ■ Record update Records Query engine ■ Records can be used even while not persisted joli.js Mirakl Coeur Mirakl Coeur CodeStrong - Abstracting databases access in Titanium Mobile 33 Xavier Lacot | September 2011
  • 34. Create new records // first method var john = models.human.newRecord({ first_name: 'John', last_name: 'Doe' }); // second method var john = new joli.record(models.human); john.fromArray({ first_name: 'John', last_name: 'Doe' }); // third method var john = new joli.record(models.human); john.set('first_name', 'John'); john.set('last_name', 'Doe'); CodeStrong - Abstracting databases access in Titanium Mobile 34 Xavier Lacot | September 2011
  • 35. Manipulate records // persist a record john.save(); // destroy it john.destroy(); // get a property var name = john.get('last_name'); // export to an array var johnArray = john.toArray(); var json = JSON.stringify(johnArray); // {"id":"110","lastname":"Doe","firstname":"John","company_name":"ACME"} CodeStrong - Abstracting databases access in Titanium Mobile 35 Xavier Lacot | September 2011
  • 36. Query engine Models container ■ Abstract the way queries are run against the database Models ■ Stop writing SQL Migrations ■ Use chained method calls « à la jQuery » Records ■ Have hydratation facilities Query engine joli.js Mirakl Coeur Mirakl Coeur CodeStrong - Abstracting databases access in Titanium Mobile 36 Xavier Lacot | September 2011
  • 37. Querying the model ■ No more SQL queries ■ Let's introduce an OOP querying model ■ Queries are objects ■ They can be execute() 'd // create the query object var q = new joli.query() .select() .from('human') .where('last_name = ?', 'Doe'); // let's execute it var humans = q.execute(); CodeStrong - Abstracting databases access in Titanium Mobile 37 Xavier Lacot | September 2011
  • 38. A complete SQL-like vocabulary ■ : Several methods for building queries: ■ count() ■ set() ■ destroy() ■ update() ■ from() ■ values() ■ groupBy() ■ where() ■ insertInto() ■ whereIn() ■ join() ■ limit() ■ order() CodeStrong - Abstracting databases access in Titanium Mobile 38 Xavier Lacot | September 2011
  • 39. Progressive query construction api.getActiveQuery = function(q) { if (!q) { ■ Queries as objects are q = new joli.query() .from('news'); easy to handle } q.where('active = ?', true); ■ No matter the order in return q; }; which you call the api.getLastPublished = function() { query methods! return api .getActiveQuery() .limit(1) .orderBy('created_at desc') .execute(); } api.getPublished = function() { return api .getActiveQuery() .orderBy('created_at desc') .execute(); } CodeStrong - Abstracting databases access in Titanium Mobile 39 Xavier Lacot | September 2011
  • 40. Let's talk about hydration ■ Calling execute() will: ■ Build the query string; ■ Send it to joli.Connection() for its execution; ■ And create a bunch of record objects (one per result). ■ This last step is called « hydration » ■ It can cost time. A lot. ■ Joli.js offers a way to hydrate plain arrays, not complete joli.js records. CodeStrong - Abstracting databases access in Titanium Mobile 40 Xavier Lacot | September 2011
  • 41. Let's talk about hydratation var people = new joli.query() .select() .from('people') .execute(); // people is an array of objects var people = new joli.query() .select() .from('people') .execute('array'); // people is a simple plain array ■ An ORM as a cost, sure, but you can make it invisible to the user ■ Save you app, take care to the performances CodeStrong - Abstracting databases access in Titanium Mobile 41 Xavier Lacot | September 2011
  • 42. Querying useful methods ■ getSqlQuery() returns the string that will be generated when executing the query var q = new joli.query() .select() .from('view_count') .where('nb_views between ? And ?', [1000, 2000]); var queryString = q.getSqlQuery(); // select * from view_count where nb_views between "1000" and "2000" ■ All the queries go through joli.Connection.execute(). Possibility to log things here and see what is happening. CodeStrong - Abstracting databases access in Titanium Mobile 42 Xavier Lacot | September 2011
  • 43. Unit tests ■ Joli.js is unit-tested using titanium-jasmine ■ 90+ tests and growing ■ See https://github.com/xavierlacot/joli.js-demo for the test suite CodeStrong - Abstracting databases access in Titanium Mobile 43 Xavier Lacot | September 2011
  • 44. Summary 1. Using databases in Titanium Mobile applications 2. Who said "pain"? 3. The ORM concept 4. Various js ORMs available ■ Titanium Mobile compatibility chart 5. A focus on joli.js ■ Main use ■ Joli API extension CodeStrong - Abstracting databases access in Titanium Mobile 44 Xavier Lacot | September 2011
  • 45. Joli API extension ■ We often need to synchronize data from/to the Web ■ Case sample : an online address book ■ We want the contacts to be available on the phone even when not connected ■ The contacts list must also be available online ■ Here comes joli.api.js, the little brother to joli.js CodeStrong - Abstracting databases access in Titanium Mobile 45 Xavier Lacot | September 2011
  • 46. Joli API extension ■ joli.api.js is a wrapper to joli.js, which makes synchronization to REST web services easy joli.js joli.js REST Web joli.api.js joli.api.js Service Mobile application Mobile application ■ All CRUD operations are available : GET / POST / PUT / DELETE CodeStrong - Abstracting databases access in Titanium Mobile 46 Xavier Lacot | September 2011
  • 47. Let's have a small demo ■ A Titanium-powered synchronized AddressBook ■ Code will be available at https://github.com/xavierlacot/joli.api.js-app-demo ■ Uses REST APIs built in PHP with the Symfony framework CodeStrong - Abstracting databases access in Titanium Mobile 47 Xavier Lacot | September 2011
  • 48. API synchronized model declaration joli.apimodel var people = new joli.apimodel({ table: 'people', columns: { id: 'INTEGER PRIMARY KEY AUTOINCREMENT', firstname: 'TEXT', lastname: 'TEXT', company_name: 'TEXT', email: 'TEXT', phone: 'TEXT', picture_url: 'TEXT' }, updateTime: 86400, url: 'http://local.example.com/api/people.json' }); The REST endpoint url CodeStrong - Abstracting databases access in Titanium Mobile 48 Xavier Lacot | September 2011
  • 49. Using the API ■ Minor changes compared to joli.js The exact same method // selects from the database // if no result and the updateTime is gone, checks the API var peoples = joli.models.get('people').all({ order: ['lastname asc', 'firstname asc'] }); // creates the record and saves it to the REST endpoint joli.models.get('people') .newRecord(values, true) .save(); Should the record be CodeStrong - Abstracting databases access in Titanium Mobile synchronized? 49 Xavier Lacot | September 2011
  • 50. This is Free and Open Source Software... ■ All the code is here : ■ joli.js - https://github.com/xavierlacot/joli.js ■ joli.api.js - https://github.com/xavierlacot/joli.api.js ■ joli.js test suite - https://github.com/xavierlacot/joli.js-demo ■ joli.api.js demo application - https://github.com/xavierlacot/joli.api.js-app-demo CodeStrong - Abstracting databases access in Titanium Mobile 50 Xavier Lacot | September 2011
  • 51. Let's have a small demo ■ This app was built completely while I was in the plane. Less than 4 hours coding! // persist the values of the form button.addEventListener('click', function() { // extractValues() builds an associative array of the form values save(extractValues(container)); win.close(); }); var save = function(values) { joli.models.get('people').newRecord(values, true).save(); }; [INFO] POST request to url http://local.example.com/api/people.json [INFO] Received from the service: [INFO] {"id":"111","lastname":"Lacot","firstname":"Xavier", ...} [INFO] 1 new record(s), 0 record(s) updated. [DEBUG] fire app event: joli.records.saved CodeStrong - Abstracting databases access in Titanium Mobile 51 Xavier Lacot | September 2011
  • 52. Roadmap and whishlist... ■ Joli.js: ■ Abstract the configuration ■ Logging enabled or not, default hydration model ■ Easy support for several databases ■ Improve migrations, add more unit tests ■ Joli.api.js ■ Support for all the HTTP methods ■ Make it possible to map the Data model to different REST services formats Keep all this fun, short and efficient CodeStrong - Abstracting databases access in Titanium Mobile 52 Xavier Lacot | September 2011
  • 53. CodeStrong - Abstracting databases access in Titanium Mobile 53 Xavier Lacot | September 2011