SlideShare une entreprise Scribd logo
1  sur  46
BEAR (Sunday)
   PHP 5.3+ /5.4
1. namespace
1. namespace


use couponAppAuth as couponAuth;

use blogAppAuth as blogAuth;

read ro:://coupon/User?id=1
read ro:://blog/User?id=1
2. DI
Say goodbye to
BEAR::Dependency()
Say hello to
BEARDi::Container();
ra .Di
             Au
          by
      red
P owe
Dependency Injection
  the JSR 330 way

       DI
namespace BEARTestexampleAppLog;



/**                                             Singleton
  * BEAR
  *                                             Prototype
  * @Scope("singleton")               @Scope
  */                                            Session
class Log
{                                               Application
     /**
      * Reource
      *
      * @Inject                       @Inject   Property Injection
      *
      * @var Resource
      */
     private $resource;

    /**
     * Di
     *
     * @Inject
     *
     * @var Di
     */
    private $di;

    /**
     * Init
*
 * @var Di
 */
private $di;

/**
  * Init
  *
  * @PostConstruct
                                @PostConstruct Initialization
  */
public function onInit()
{
     $this->inited = true;
}

/**
  * @PreDestoroy                @PreDestory   Finalization
  */
public function onEnd()
{
}

/**
  * @Inject                     @Inject Setter Injection
  *
  * @param Db $db
  */
public function setDb(Db $db)
{
}
}

/**
  * @PreDestoroy                @PreDestory       Finalization
  */
public function onEnd()
{
}

/**
  * @Inject                     @Inject Setter Injection
  *
  * @param Db $db
  */
public function setDb(Db $db)
{
}

/**
  * @Inject
  * @Named("user=admin_user,db=test_db") @Named
  *
  * @param Db $db
  *
  */
public function setDouble(User $user, Db $db)
{
     $this->db = $db;
}
2. Annotation
•
•
•
/**
  * Blog info
  *
  * @Template(user.tpl)
  * @Cache(life=0)          Inversion of Control
  * @Pager(item=10)
  * @Pull(“ro://self/User/Login”)
  */
public function onRead($values)
{
     $this->set();
}




         @Pull
3.More Resource Oriented
App_Main::run($class);
App_Main::run($class);
$params = $di->get(‘params’)->setOption($option);
$page = $di->factory('testappAppPageHelloWorld');
$ro = $di->get('main')->request($page, $params)->getRo();
$ro->output();




                                                            Ro
3.Resource Interface
Page
                                 Ro


function request(Ro $ro, Params $params)

function output(Ro $ro)
Page
                                 Ro


function request(Ro $ro, Params $params)
Page
                                 Ro


function request(Ro $ro, Params $params)
Main
Page

                                    Page
                                    Ro


   function request(Ro $ro, Params $params)

   function output(Ro $ro)
PageAdapter::request(Ro $ro, Params $params);




Main
Page

                                               Page
                                               Ro


   function request(Ro $ro, Params $params)

   function output(Ro $ro)
PageAdapter::request(Ro $ro, Params $params);




Main
Page

                                               Page
                                               Ro


   function request(Ro $ro, Params $params)

   function output(Ro $ro)
mod_php


Web




                Apache         Page
                               Ro


      Web

      Apache   PHP
Resource Interface
                                       pageAdapter::request($page, $params);



                                                                  roAdapter::request($page, $params);



                                                                  read User?id=1
          GET /User?id=1      request($page, $params);         request($ro, $params);


Browser                    Main                      Page                          Ro
               HTTP                       $ro                           $ro
          $ro->output();




                                                                                   Ro
•

•   Page   Page
4.CQRS
CQRS
Command and Query
   Responsibility
    Segregation
CQS:




       -Bertrand Meyer
            http://d.hatena.ne.jp/digitalsoul/20100712/1278886009
CQRS + REST = ?
CQS:                                             DELETE
                                               UPDATE
                                              CREATE

                                              READ




                                         REST GET
                                    Side Effect FREE

       -Bertrand Meyer
              http://d.hatena.ne.jp/digitalsoul/20100712/1278886009
          DDD/Side -Effect-Free Functions - Java EE
CQRS + REST = BEAR
NoSQL
          QUERY
       read User?id=1




                               <h2>koriym</h2>
     Client                    <ul>
                               <li>name: Koriama</li>
                                                        Representation
                               </ul>




        COMMAND                                            Resource
update User?id=1&name=koriym

                                          RDB (MySQL)
NoSQL
           QUERY
        read User?id=1
Query    Command
                Query
                         Command


                                <h2>koriym</h2>
Command                        Query
     Client                     <ul>
                                <li>name: Koriama</li>
                                </ul>




          COMMAND         PC ,iPhone               AJAX   ...
  update User?id=1&name=koriym

                                           RDB (MySQL)
5.Compatibility
Compatibility
• Saturday(for 5.2)

•                     (=Shared nothing)
                                A

• Ro
•
                                ...
CM gtalk
                                        realtime
                         observe
                                    GUI MVC




         6.RealTime
$this->set(‘user’, $user, ‘realtime’);

$this->set(‘user’, $user, ‘ajax’);




                                                  bi ted
                                                Or
                                             by
                                         red
                                   P owe
7.Multi Language
       PHP Page      Java Resource


Objective-C Client   PHP Resource


                                                    hr ift
                                               b y T
                                      we red
                                    Po
8. Online editor
fully supported

                                 di tor
                            A ceE
                       by
                   red
              Powe
design memo at
https://gist.github.com/1111850

Contenu connexe

Tendances

When RSS Fails: Web Scraping with HTTP
When RSS Fails: Web Scraping with HTTPWhen RSS Fails: Web Scraping with HTTP
When RSS Fails: Web Scraping with HTTPMatthew Turland
 
Migrating PriceChirp to Rails 3.0: The Pain Points
Migrating PriceChirp to Rails 3.0: The Pain PointsMigrating PriceChirp to Rails 3.0: The Pain Points
Migrating PriceChirp to Rails 3.0: The Pain PointsSteven Evatt
 
Web Apps in Perl - HTTP 101
Web Apps in Perl - HTTP 101Web Apps in Perl - HTTP 101
Web Apps in Perl - HTTP 101hendrikvb
 
Apigility reloaded
Apigility reloadedApigility reloaded
Apigility reloadedRalf Eggert
 
Perl web frameworks
Perl web frameworksPerl web frameworks
Perl web frameworksdiego_k
 
Modern Getopt for Command Line Processing in Perl
Modern Getopt for Command Line Processing in PerlModern Getopt for Command Line Processing in Perl
Modern Getopt for Command Line Processing in PerlNova Patch
 
How to use MongoDB with CakePHP
How to use MongoDB with CakePHPHow to use MongoDB with CakePHP
How to use MongoDB with CakePHPichikaway
 
News of the Symfony2 World
News of the Symfony2 WorldNews of the Symfony2 World
News of the Symfony2 WorldFabien Potencier
 
Create your own PHP extension, step by step - phpDay 2012 Verona
Create your own PHP extension, step by step - phpDay 2012 VeronaCreate your own PHP extension, step by step - phpDay 2012 Verona
Create your own PHP extension, step by step - phpDay 2012 VeronaPatrick Allaert
 
用Tornado开发RESTful API运用
用Tornado开发RESTful API运用用Tornado开发RESTful API运用
用Tornado开发RESTful API运用Felinx Lee
 

Tendances (20)

When RSS Fails: Web Scraping with HTTP
When RSS Fails: Web Scraping with HTTPWhen RSS Fails: Web Scraping with HTTP
When RSS Fails: Web Scraping with HTTP
 
Migrating PriceChirp to Rails 3.0: The Pain Points
Migrating PriceChirp to Rails 3.0: The Pain PointsMigrating PriceChirp to Rails 3.0: The Pain Points
Migrating PriceChirp to Rails 3.0: The Pain Points
 
Debugging on rails
Debugging on railsDebugging on rails
Debugging on rails
 
Web Apps in Perl - HTTP 101
Web Apps in Perl - HTTP 101Web Apps in Perl - HTTP 101
Web Apps in Perl - HTTP 101
 
Apigility reloaded
Apigility reloadedApigility reloaded
Apigility reloaded
 
SQLite Techniques
SQLite TechniquesSQLite Techniques
SQLite Techniques
 
PHP5.5 is Here
PHP5.5 is HerePHP5.5 is Here
PHP5.5 is Here
 
Rest in flask
Rest in flaskRest in flask
Rest in flask
 
Perl web frameworks
Perl web frameworksPerl web frameworks
Perl web frameworks
 
Modern Getopt for Command Line Processing in Perl
Modern Getopt for Command Line Processing in PerlModern Getopt for Command Line Processing in Perl
Modern Getopt for Command Line Processing in Perl
 
Spl in the wild
Spl in the wildSpl in the wild
Spl in the wild
 
How to use MongoDB with CakePHP
How to use MongoDB with CakePHPHow to use MongoDB with CakePHP
How to use MongoDB with CakePHP
 
Developing apps using Perl
Developing apps using PerlDeveloping apps using Perl
Developing apps using Perl
 
Web Scraping with PHP
Web Scraping with PHPWeb Scraping with PHP
Web Scraping with PHP
 
News of the Symfony2 World
News of the Symfony2 WorldNews of the Symfony2 World
News of the Symfony2 World
 
Create your own PHP extension, step by step - phpDay 2012 Verona
Create your own PHP extension, step by step - phpDay 2012 VeronaCreate your own PHP extension, step by step - phpDay 2012 Verona
Create your own PHP extension, step by step - phpDay 2012 Verona
 
Txjs
TxjsTxjs
Txjs
 
用Tornado开发RESTful API运用
用Tornado开发RESTful API运用用Tornado开发RESTful API运用
用Tornado开发RESTful API运用
 
RESTful web services
RESTful web servicesRESTful web services
RESTful web services
 
CodeIgniter 3.0
CodeIgniter 3.0CodeIgniter 3.0
CodeIgniter 3.0
 

En vedette

En vedette (7)

BEAR Architecture
BEAR ArchitectureBEAR Architecture
BEAR Architecture
 
BEAR.Sunday.meetup #0
BEAR.Sunday.meetup #0BEAR.Sunday.meetup #0
BEAR.Sunday.meetup #0
 
An object graph visualizer for PHP - print_o
An object graph visualizer for PHP - print_oAn object graph visualizer for PHP - print_o
An object graph visualizer for PHP - print_o
 
BEAR.Sunday@phpcon2012
BEAR.Sunday@phpcon2012BEAR.Sunday@phpcon2012
BEAR.Sunday@phpcon2012
 
BEAR.Sunday Offline Talk
BEAR.Sunday Offline TalkBEAR.Sunday Offline Talk
BEAR.Sunday Offline Talk
 
BEAR.Sunday Note
BEAR.Sunday NoteBEAR.Sunday Note
BEAR.Sunday Note
 
BEAR.Sunday $app
BEAR.Sunday $appBEAR.Sunday $app
BEAR.Sunday $app
 

Similaire à PHP 5.3+ Framework for Building RESTful Web Services

Drupal 7 module development
Drupal 7 module developmentDrupal 7 module development
Drupal 7 module developmentAdam Kalsey
 
Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)
Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)
Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)James Titcumb
 
Creating REST Applications with the Slim Micro-Framework by Vikram Vaswani
Creating REST Applications with the Slim Micro-Framework by Vikram VaswaniCreating REST Applications with the Slim Micro-Framework by Vikram Vaswani
Creating REST Applications with the Slim Micro-Framework by Vikram Vaswanivvaswani
 
A resource oriented framework using the DI/AOP/REST triangle
A resource oriented framework using the DI/AOP/REST triangleA resource oriented framework using the DI/AOP/REST triangle
A resource oriented framework using the DI/AOP/REST triangleAkihito Koriyama
 
Rails 2.0 Presentation
Rails 2.0 PresentationRails 2.0 Presentation
Rails 2.0 PresentationScott Chacon
 
2019 11-bgphp
2019 11-bgphp2019 11-bgphp
2019 11-bgphpdantleech
 
Kicking off with Zend Expressive and Doctrine ORM (Sunshine PHP 2017)
Kicking off with Zend Expressive and Doctrine ORM (Sunshine PHP 2017)Kicking off with Zend Expressive and Doctrine ORM (Sunshine PHP 2017)
Kicking off with Zend Expressive and Doctrine ORM (Sunshine PHP 2017)James Titcumb
 
Motion Django Meetup
Motion Django MeetupMotion Django Meetup
Motion Django MeetupMike Malone
 
Psgi Plack Sfpm
Psgi Plack SfpmPsgi Plack Sfpm
Psgi Plack Sfpmsom_nangia
 
Psgi Plack Sfpm
Psgi Plack SfpmPsgi Plack Sfpm
Psgi Plack Sfpmwilburlo
 
Clojure and the Web
Clojure and the WebClojure and the Web
Clojure and the Webnickmbailey
 
What's New In Laravel 5
What's New In Laravel 5What's New In Laravel 5
What's New In Laravel 5Darren Craig
 
CodeIgniter PHP MVC Framework
CodeIgniter PHP MVC FrameworkCodeIgniter PHP MVC Framework
CodeIgniter PHP MVC FrameworkBo-Yi Wu
 
Exploring Async PHP (SF Live Berlin 2019)
Exploring Async PHP (SF Live Berlin 2019)Exploring Async PHP (SF Live Berlin 2019)
Exploring Async PHP (SF Live Berlin 2019)dantleech
 
関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐいHisateru Tanaka
 

Similaire à PHP 5.3+ Framework for Building RESTful Web Services (20)

Drupal 7 module development
Drupal 7 module developmentDrupal 7 module development
Drupal 7 module development
 
Intro to PSGI and Plack
Intro to PSGI and PlackIntro to PSGI and Plack
Intro to PSGI and Plack
 
Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)
Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)
Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)
 
Creating REST Applications with the Slim Micro-Framework by Vikram Vaswani
Creating REST Applications with the Slim Micro-Framework by Vikram VaswaniCreating REST Applications with the Slim Micro-Framework by Vikram Vaswani
Creating REST Applications with the Slim Micro-Framework by Vikram Vaswani
 
A resource oriented framework using the DI/AOP/REST triangle
A resource oriented framework using the DI/AOP/REST triangleA resource oriented framework using the DI/AOP/REST triangle
A resource oriented framework using the DI/AOP/REST triangle
 
Building web APIs in PHP with Zend Expressive
Building web APIs in PHP with Zend ExpressiveBuilding web APIs in PHP with Zend Expressive
Building web APIs in PHP with Zend Expressive
 
Rails 2.0 Presentation
Rails 2.0 PresentationRails 2.0 Presentation
Rails 2.0 Presentation
 
2019 11-bgphp
2019 11-bgphp2019 11-bgphp
2019 11-bgphp
 
Kicking off with Zend Expressive and Doctrine ORM (Sunshine PHP 2017)
Kicking off with Zend Expressive and Doctrine ORM (Sunshine PHP 2017)Kicking off with Zend Expressive and Doctrine ORM (Sunshine PHP 2017)
Kicking off with Zend Expressive and Doctrine ORM (Sunshine PHP 2017)
 
Api
ApiApi
Api
 
Motion Django Meetup
Motion Django MeetupMotion Django Meetup
Motion Django Meetup
 
Psgi Plack Sfpm
Psgi Plack SfpmPsgi Plack Sfpm
Psgi Plack Sfpm
 
Psgi Plack Sfpm
Psgi Plack SfpmPsgi Plack Sfpm
Psgi Plack Sfpm
 
Clojure and the Web
Clojure and the WebClojure and the Web
Clojure and the Web
 
What's New In Laravel 5
What's New In Laravel 5What's New In Laravel 5
What's New In Laravel 5
 
Plack - LPW 2009
Plack - LPW 2009Plack - LPW 2009
Plack - LPW 2009
 
CodeIgniter PHP MVC Framework
CodeIgniter PHP MVC FrameworkCodeIgniter PHP MVC Framework
CodeIgniter PHP MVC Framework
 
Bpstudy20101221
Bpstudy20101221Bpstudy20101221
Bpstudy20101221
 
Exploring Async PHP (SF Live Berlin 2019)
Exploring Async PHP (SF Live Berlin 2019)Exploring Async PHP (SF Live Berlin 2019)
Exploring Async PHP (SF Live Berlin 2019)
 
関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい
 

Plus de Akihito Koriyama

Plus de Akihito Koriyama (7)

PHPカンファレンス関西2014 「全てを結ぶ力」
PHPカンファレンス関西2014 「全てを結ぶ力」PHPカンファレンス関西2014 「全てを結ぶ力」
PHPカンファレンス関西2014 「全てを結ぶ力」
 
PHP Coding in BEAR.Sunday
PHP Coding in BEAR.SundayPHP Coding in BEAR.Sunday
PHP Coding in BEAR.Sunday
 
BEAR.Sunday 1.X
BEAR.Sunday 1.XBEAR.Sunday 1.X
BEAR.Sunday 1.X
 
PHP: Dis Is It
PHP: Dis Is ItPHP: Dis Is It
PHP: Dis Is It
 
The new era of PHP web development.
The new era of PHP web development.The new era of PHP web development.
The new era of PHP web development.
 
BEAR DI
BEAR DIBEAR DI
BEAR DI
 
BEAR v0.9 (Saturday)
BEAR v0.9 (Saturday)BEAR v0.9 (Saturday)
BEAR v0.9 (Saturday)
 

Dernier

Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 

Dernier (20)

Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 

PHP 5.3+ Framework for Building RESTful Web Services

  • 1. BEAR (Sunday) PHP 5.3+ /5.4
  • 3. 1. namespace use couponAppAuth as couponAuth; use blogAppAuth as blogAuth; read ro:://coupon/User?id=1 read ro:://blog/User?id=1
  • 7.
  • 8. ra .Di Au by red P owe
  • 9.
  • 10. Dependency Injection the JSR 330 way DI
  • 11. namespace BEARTestexampleAppLog; /** Singleton * BEAR * Prototype * @Scope("singleton") @Scope */ Session class Log { Application /** * Reource * * @Inject @Inject Property Injection * * @var Resource */ private $resource; /** * Di * * @Inject * * @var Di */ private $di; /** * Init
  • 12. * * @var Di */ private $di; /** * Init * * @PostConstruct @PostConstruct Initialization */ public function onInit() { $this->inited = true; } /** * @PreDestoroy @PreDestory Finalization */ public function onEnd() { } /** * @Inject @Inject Setter Injection * * @param Db $db */ public function setDb(Db $db) { }
  • 13. } /** * @PreDestoroy @PreDestory Finalization */ public function onEnd() { } /** * @Inject @Inject Setter Injection * * @param Db $db */ public function setDb(Db $db) { } /** * @Inject * @Named("user=admin_user,db=test_db") @Named * * @param Db $db * */ public function setDouble(User $user, Db $db) { $this->db = $db; }
  • 16. /** * Blog info * * @Template(user.tpl) * @Cache(life=0) Inversion of Control * @Pager(item=10) * @Pull(“ro://self/User/Login”) */ public function onRead($values) { $this->set(); } @Pull
  • 20. $params = $di->get(‘params’)->setOption($option); $page = $di->factory('testappAppPageHelloWorld'); $ro = $di->get('main')->request($page, $params)->getRo(); $ro->output(); Ro
  • 22. Page Ro function request(Ro $ro, Params $params) function output(Ro $ro)
  • 23. Page Ro function request(Ro $ro, Params $params)
  • 24. Page Ro function request(Ro $ro, Params $params)
  • 25. Main Page Page Ro function request(Ro $ro, Params $params) function output(Ro $ro)
  • 26. PageAdapter::request(Ro $ro, Params $params); Main Page Page Ro function request(Ro $ro, Params $params) function output(Ro $ro)
  • 27. PageAdapter::request(Ro $ro, Params $params); Main Page Page Ro function request(Ro $ro, Params $params) function output(Ro $ro)
  • 28. mod_php Web Apache Page Ro Web Apache PHP
  • 29. Resource Interface pageAdapter::request($page, $params); roAdapter::request($page, $params); read User?id=1 GET /User?id=1 request($page, $params); request($ro, $params); Browser Main Page Ro HTTP $ro $ro $ro->output(); Ro
  • 30. • • Page Page
  • 32. CQRS Command and Query Responsibility Segregation
  • 33. CQS: -Bertrand Meyer http://d.hatena.ne.jp/digitalsoul/20100712/1278886009
  • 34.
  • 35.
  • 36. CQRS + REST = ?
  • 37. CQS: DELETE UPDATE CREATE READ REST GET Side Effect FREE -Bertrand Meyer http://d.hatena.ne.jp/digitalsoul/20100712/1278886009 DDD/Side -Effect-Free Functions - Java EE
  • 38. CQRS + REST = BEAR
  • 39. NoSQL QUERY read User?id=1 <h2>koriym</h2> Client <ul> <li>name: Koriama</li> Representation </ul> COMMAND Resource update User?id=1&name=koriym RDB (MySQL)
  • 40. NoSQL QUERY read User?id=1 Query Command Query Command <h2>koriym</h2> Command Query Client <ul> <li>name: Koriama</li> </ul> COMMAND PC ,iPhone AJAX ... update User?id=1&name=koriym RDB (MySQL)
  • 42. Compatibility • Saturday(for 5.2) • (=Shared nothing) A • Ro • ...
  • 43. CM gtalk realtime observe GUI MVC 6.RealTime $this->set(‘user’, $user, ‘realtime’); $this->set(‘user’, $user, ‘ajax’); bi ted Or by red P owe
  • 44. 7.Multi Language PHP Page Java Resource Objective-C Client PHP Resource hr ift b y T we red Po
  • 45. 8. Online editor fully supported di tor A ceE by red Powe

Notes de l'éditeur

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n