Fezai Wael

MEDAAS

fzwael@gmail.com

Web Services

  • Web Services
  • RESTful API
  • PHP & REST
  • Slim framework
  • Example

Application Mobile

  • Native or Hybrid?
  • AngularJs & Ionic

Web Services

What we have

What we want

Pourquoi un webservice?

Les services Web fournissent un lien entre applications. Ainsi, des applications utilisant des technologies différentes peuvent envoyer et recevoir des données au travers de protocoles compréhensibles par tout le monde.

SOAP ou REST?

RESTful API

PHP & REST

Slim framework

Why use framework

Slim framework

  • One of the fastest micro RESTful PHP frameworks, arguably TOP 5
  • Currently best-known framework of this type
  • Great documentation plus 3rd party community support
  • Excellent for large projects

Example

<?php
require 'db.php';
require 'Slim/Slim.php';
\Slim\Slim::registerAutoloader();

$app = new \Slim\Slim();

$app->get('/users','getUsers');
$app->get('/updates','getUserUpdates');
$app->post('/updates', 'insertUpdate');
$app->delete('/updates/delete/:update_id','deleteUpdate');
$app->get('/users/search/:query','getUserSearch');

$app->run();

.
.
.
http://www.thomas-bayer.com/sqlrest/CUSTOMER/
{
  "users":[
    {
      "user_id":1,
      "name":"Chris Rivers",
      "mention_name":"chris",
      "email":"chris@hipchat.com",
      "title":"Developer",
      "photo_url":"https:\/\/www.hipchat.com\/chris.png",
      "last_active":1360031425,
      "created":1315711352,
      "status":"away",
      "status_message":"gym, bbl",
      "is_group_admin":1,
      "is_deleted":0
    },
    {
      "user_id":3,
      "name":"Peter Curley",
      "mention_name":"pete",
      "email":"pete@hipchat.com",
      "title":"Designer",
      "photo_url":"https:\/\/www.hipchat.com\/pete.png",
      "last_active":1360031425,
      "created":1315711352,
      "status":"offline",
      "status_message":"",
      "is_group_admin":1,
      "is_deleted":0
    },
    {
      "user_id":5,
      "name":"Garret Heaton",
      "mention_name":"garret",
      "email":"garret@hipchat.com",
      "title":"Co-founder",
      "photo_url":"https:\/\/www.hipchat.com\/garret.png",
      "last_active":1360031425,
      "created":1315711352,
      "status":"available",
      "status_message":"Come see what I'm working on!",
      "is_group_admin":1,
      "is_deleted":0
    }
  ]
}

Native or Hybrid

AngularJs & Ionic

AngularJs

  • AngularJS extends HTML with new attributes.
  • AngularJS is perfect for Single Page Applications (SPAs).

Ionic

Ionic is the beautiful, open source front-end SDK for developing hybrid mobile apps with web technologies.

Fezai Wael

By Wael Fezai

Fezai Wael

Medaas

  • 454