SlideShare a Scribd company logo
1 of 40
CakePHP +
My Development Story
Takahiro Fujiwara @tfmagician
Amazon   …
/
                                           github


CakePHP        Amazon A2S(   ECS4.0)

 Amazon-eCommerce-datasource




   github   ”cake amazon”
...
XML


CD/       /            (Author/Artist),(Title),
                  (Releasedate/Publicationdate)




      /       /
extends
                    libs

   AppController

 shell controller



     $jenreID/$subJenreID
Sample Extends
 1 <?php
 2 App::import('Controller', 'libs/author_checks');
 3
 4 class CdArtistChecksController extends AuthorChecksController {
 5      var $name = 'CdArtistChecks';
 6      var $jenreID = 'Cd';
 7      var $subJenreID = 'Artist';
 8}
 9 ?>
Sample Extends
 <?php
  2 class AuthorChecksController extends AppController {
  3      var $helpers = array('Html', 'Form');
  4      var $paginate = array(
  5           'AuthorCheck' => array(
  6                 'limit' => 10,
  7                 'conditions' => array('deleted' => 0),
  8                 'order' => array('created' => 'asc'),
  9                 'contain' => false,
 10                  'with' => 'suggests'));
 11
 12       function __construct() {
 13            $this->jenreID = Inflector::Camelize($this->jenreID);
 14            $this->subJenreID = Inflector::Camelize($this->subJenreID);
 15            $this->prefix = $this->jenreID.$this->subJenreID;
controller shell
GUI   (Controller       )



CUI   (Shell        )
...
controller + shell = Spaghetti
VMC
VMC

      ... Model

                  ...
...
Controller/Shell   ...
ClassRegistory::init

         constructor

  ClassRegistory::init
Sample ClassRegistory
 1 <?php
 2 class AuthorModel extends AppModel {
 3      function __construct($id = false, $table = NULL, $ds = NULL){
 4           $this->jenreID = Inflector::Camelize($this->jenreID);
 5           $this->subJenreID = Inflector::Camelize($this->subJenreID);
 6           $this->prefix = $this->jenreID.$this->subJenreID;
 7           App::Import('Model',
               array($this->prefix.'NRWord',
                    $this->prefix.'SWord',
                    $this->prefix.'Check'));
 8           $this->{$this->prefix.'NRWord'} =
               ClassRegistry::init($this->prefix.'NRWord');

                                                        constructor
          ClassRegistory
             PHP
...
A2S   ClassRegistory
...SQL
A2S



              ...

query               SQL
useDbConfig


               useDbConfig



 amazon_ecommerce
Sample TestCase
  6 class CdItemTestCase extends CakeTestCase {
  7      var $CdItem = null;
  8      var $fixtures = array(
 23            );
 24
 25       function startTest() {
 26            $this->CdItem =& ClassRegistry::init('CdItem');
 27            $this->CdItem->AmazonAdvertising->
                  useDbConfig = 'amazon_ecommerce';
 28       }
App::import

            Behavior                 ...

ClassRegistory::init   constructor
m(_ _)m
VMware Fusion
 Ubuntu 9.04
 ssh   Mac

                Apache

   Mac/Ubuntu

More Related Content

What's hot

20 modules i haven't yet talked about
20 modules i haven't yet talked about20 modules i haven't yet talked about
20 modules i haven't yet talked about
Tatsuhiko Miyagawa
 

What's hot (20)

Symfony War Stories
Symfony War StoriesSymfony War Stories
Symfony War Stories
 
20 modules i haven't yet talked about
20 modules i haven't yet talked about20 modules i haven't yet talked about
20 modules i haven't yet talked about
 
PHP pod mikroskopom
PHP pod mikroskopomPHP pod mikroskopom
PHP pod mikroskopom
 
Object Calisthenics Adapted for PHP
Object Calisthenics Adapted for PHPObject Calisthenics Adapted for PHP
Object Calisthenics Adapted for PHP
 
Aplicacoes dinamicas Rails com Backbone
Aplicacoes dinamicas Rails com BackboneAplicacoes dinamicas Rails com Backbone
Aplicacoes dinamicas Rails com Backbone
 
Ruby - Design patterns tdc2011
Ruby - Design patterns tdc2011Ruby - Design patterns tdc2011
Ruby - Design patterns tdc2011
 
Bag of tricks
Bag of tricksBag of tricks
Bag of tricks
 
Hidden in plain site – joomla! hidden secrets for code monkeys
Hidden in plain site – joomla! hidden secrets for code monkeysHidden in plain site – joomla! hidden secrets for code monkeys
Hidden in plain site – joomla! hidden secrets for code monkeys
 
The command dispatcher pattern
The command dispatcher patternThe command dispatcher pattern
The command dispatcher pattern
 
Silex meets SOAP & REST
Silex meets SOAP & RESTSilex meets SOAP & REST
Silex meets SOAP & REST
 
Design Patterns avec PHP 5.3, Symfony et Pimple
Design Patterns avec PHP 5.3, Symfony et PimpleDesign Patterns avec PHP 5.3, Symfony et Pimple
Design Patterns avec PHP 5.3, Symfony et Pimple
 
So cal0365productivitygroup feb2019
So cal0365productivitygroup feb2019So cal0365productivitygroup feb2019
So cal0365productivitygroup feb2019
 
Your code sucks, let's fix it
Your code sucks, let's fix itYour code sucks, let's fix it
Your code sucks, let's fix it
 
The History of PHPersistence
The History of PHPersistenceThe History of PHPersistence
The History of PHPersistence
 
Database Design Patterns
Database Design PatternsDatabase Design Patterns
Database Design Patterns
 
Melhorando sua API com DSLs
Melhorando sua API com DSLsMelhorando sua API com DSLs
Melhorando sua API com DSLs
 
循環参照のはなし
循環参照のはなし循環参照のはなし
循環参照のはなし
 
Feeds drupal cafe
Feeds drupal cafeFeeds drupal cafe
Feeds drupal cafe
 
TestFest - Respect\Validation 1.0
TestFest - Respect\Validation 1.0TestFest - Respect\Validation 1.0
TestFest - Respect\Validation 1.0
 
Introduccion a Jasmin
Introduccion a JasminIntroduccion a Jasmin
Introduccion a Jasmin
 

Similar to My Development Story

Beyond symfony 1.2 (Symfony Camp 2008)
Beyond symfony 1.2 (Symfony Camp 2008)Beyond symfony 1.2 (Symfony Camp 2008)
Beyond symfony 1.2 (Symfony Camp 2008)
Fabien Potencier
 

Similar to My Development Story (20)

Building Testable PHP Applications
Building Testable PHP ApplicationsBuilding Testable PHP Applications
Building Testable PHP Applications
 
PHPSpec BDD Framework
PHPSpec BDD FrameworkPHPSpec BDD Framework
PHPSpec BDD Framework
 
Quality assurance for php projects with PHPStorm
Quality assurance for php projects with PHPStormQuality assurance for php projects with PHPStorm
Quality assurance for php projects with PHPStorm
 
Symfony2 from the Trenches
Symfony2 from the TrenchesSymfony2 from the Trenches
Symfony2 from the Trenches
 
PHPSpec BDD for PHP
PHPSpec BDD for PHPPHPSpec BDD for PHP
PHPSpec BDD for PHP
 
Zend Framework Study@Tokyo #2
Zend Framework Study@Tokyo #2Zend Framework Study@Tokyo #2
Zend Framework Study@Tokyo #2
 
Ch ch-changes cake php2
Ch ch-changes cake php2Ch ch-changes cake php2
Ch ch-changes cake php2
 
Introduction to Zend Framework web services
Introduction to Zend Framework web servicesIntroduction to Zend Framework web services
Introduction to Zend Framework web services
 
Refactoring using Codeception
Refactoring using CodeceptionRefactoring using Codeception
Refactoring using Codeception
 
Fatc
FatcFatc
Fatc
 
Symfony2 - from the trenches
Symfony2 - from the trenchesSymfony2 - from the trenches
Symfony2 - from the trenches
 
Beyond symfony 1.2 (Symfony Camp 2008)
Beyond symfony 1.2 (Symfony Camp 2008)Beyond symfony 1.2 (Symfony Camp 2008)
Beyond symfony 1.2 (Symfony Camp 2008)
 
Why is crud a bad idea - focus on real scenarios
Why is crud a bad idea - focus on real scenariosWhy is crud a bad idea - focus on real scenarios
Why is crud a bad idea - focus on real scenarios
 
Unit testing after Zend Framework 1.8
Unit testing after Zend Framework 1.8Unit testing after Zend Framework 1.8
Unit testing after Zend Framework 1.8
 
Modernising Legacy Code
Modernising Legacy CodeModernising Legacy Code
Modernising Legacy Code
 
Zend framework service
Zend framework serviceZend framework service
Zend framework service
 
Zend framework service
Zend framework serviceZend framework service
Zend framework service
 
Rails is not just Ruby
Rails is not just RubyRails is not just Ruby
Rails is not just Ruby
 
Doctrine For Beginners
Doctrine For BeginnersDoctrine For Beginners
Doctrine For Beginners
 
PHPSpec - the only Design Tool you need - 4Developers
PHPSpec - the only Design Tool you need - 4DevelopersPHPSpec - the only Design Tool you need - 4Developers
PHPSpec - the only Design Tool you need - 4Developers
 

Recently uploaded

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
vu2urc
 

Recently uploaded (20)

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?
 
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
 
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...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
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
 
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
 
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
 
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
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
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
 
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
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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)
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
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
 

My Development Story

  • 1. CakePHP + My Development Story Takahiro Fujiwara @tfmagician
  • 2.
  • 3.
  • 4.
  • 5. Amazon
  • 6.
  • 7. / github CakePHP Amazon A2S( ECS4.0) Amazon-eCommerce-datasource github ”cake amazon”
  • 8. ...
  • 9. XML CD/ / (Author/Artist),(Title), (Releasedate/Publicationdate) / /
  • 10.
  • 11. extends libs AppController shell controller $jenreID/$subJenreID
  • 12. Sample Extends 1 <?php 2 App::import('Controller', 'libs/author_checks'); 3 4 class CdArtistChecksController extends AuthorChecksController { 5 var $name = 'CdArtistChecks'; 6 var $jenreID = 'Cd'; 7 var $subJenreID = 'Artist'; 8} 9 ?>
  • 13. Sample Extends <?php 2 class AuthorChecksController extends AppController { 3 var $helpers = array('Html', 'Form'); 4 var $paginate = array( 5 'AuthorCheck' => array( 6 'limit' => 10, 7 'conditions' => array('deleted' => 0), 8 'order' => array('created' => 'asc'), 9 'contain' => false, 10 'with' => 'suggests')); 11 12 function __construct() { 13 $this->jenreID = Inflector::Camelize($this->jenreID); 14 $this->subJenreID = Inflector::Camelize($this->subJenreID); 15 $this->prefix = $this->jenreID.$this->subJenreID;
  • 15.
  • 16. GUI (Controller ) CUI (Shell )
  • 17. ...
  • 18. controller + shell = Spaghetti
  • 19. VMC VMC ... Model ...
  • 20. ...
  • 21.
  • 23.
  • 24. ClassRegistory::init constructor ClassRegistory::init
  • 25. Sample ClassRegistory 1 <?php 2 class AuthorModel extends AppModel { 3 function __construct($id = false, $table = NULL, $ds = NULL){ 4 $this->jenreID = Inflector::Camelize($this->jenreID); 5 $this->subJenreID = Inflector::Camelize($this->subJenreID); 6 $this->prefix = $this->jenreID.$this->subJenreID; 7 App::Import('Model', array($this->prefix.'NRWord', $this->prefix.'SWord', $this->prefix.'Check')); 8 $this->{$this->prefix.'NRWord'} = ClassRegistry::init($this->prefix.'NRWord'); constructor ClassRegistory PHP
  • 26.
  • 27. ...
  • 28.
  • 29. A2S ClassRegistory
  • 30.
  • 32.
  • 33. A2S ... query SQL
  • 34. useDbConfig useDbConfig amazon_ecommerce
  • 35. Sample TestCase 6 class CdItemTestCase extends CakeTestCase { 7 var $CdItem = null; 8 var $fixtures = array( 23 ); 24 25 function startTest() { 26 $this->CdItem =& ClassRegistry::init('CdItem'); 27 $this->CdItem->AmazonAdvertising-> useDbConfig = 'amazon_ecommerce'; 28 }
  • 36. App::import Behavior ... ClassRegistory::init constructor
  • 38.
  • 39.
  • 40. VMware Fusion Ubuntu 9.04 ssh Mac Apache Mac/Ubuntu