SlideShare uma empresa Scribd logo
1 de 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

Mais conteúdo relacionado

Mais procurados

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
 

Mais procurados (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
 

Destaque

Destaque (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
 

Semelhante a BEAR (Suday) design

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
 

Semelhante a BEAR (Suday) design (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つまみぐい
 

Mais de Akihito Koriyama

Mais 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)
 

Último

Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024SynarionITSolutions
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
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
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
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
 
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
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 

Último (20)

Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
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
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
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
 
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...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 

BEAR (Suday) design

  • 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

Notas do Editor

  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