SlideShare a Scribd company logo
Ibuildings - http://www.ibuildings.com
Enterprise PHP development
Ivo Jansch <ivo@ibuildings.com>
Dutch PHP Conference, June 14, 2008
Tuesday, February 26, 2008 2
What's an enterprise?
•  Wikipedia:
  “Any of several ships by that name in the Star Trek
fictional universe”
  “A business, company, or comparable organization”
Tuesday, February 26, 2008 3
Is PHP Enterprise ready?
•  CIO Magazine:
“PHPworkswellforprototypingbecauseitiseasytogetasiteupandrunning.UsePHPtodesign
the site [...] but when it comes time for development, tell the team you want
t
he result to look and act like this PHP site...but in Java”
(Or: “great, this is exactly what I need! now do it again, at twice the cost!”)‫‏‬
http://www.cio.com/article/176250 (skip the article, read the comments)‫‏‬
Tuesday, February 26, 2008 4
Is PHP Enterprise ready?
 Small
 Lightweight
 Cheap
 Easy to learn
 Big
 Enterprise friendly
 enterpriCe
 CS required
Tuesday, February 26, 2008 5
A word from my girlfriend
It's not the
SIZE
of the tool...
It's how you USE it.
Tuesday, February 26, 2008 6
PHP is changing...
•  1998
  Personal stuff
•  2003
  Simple websites
  Content management
  Blogs
•  2008
  Big websites
  Banks
  Insurance Companies
  ...
Tuesday, February 26, 2008 7
PHP is changing...
•  Traditional metaphor
  PHP is like Lego bricks
  Bricks allowing you to build
anything
Tuesday, February 26, 2008 8
PHP is changing...
•  PHP is no longer a toy
  Let’s use the metaphor of actual bricks
  Because we’re building
actual buildings now
Tuesday, February 26, 2008 9
About Bricks
•  Extreme simplicity
•  Easy to learn
•  Versatile
•  Cheap
... so building a skyscraper must be peanuts, right?
Ibuildings - http://www.ibuildings.com
Enterprise development in 10 steps
Tuesday, February 26, 2008 11
Step 1 – The Team
“Dear Mr. Businessman,
I have read about your plans to build a new
skyscraper and I am applying for a job.
I have a lot of experience with Bricks. I taught
myself how to use them and have been
maintaining our family shed for a few years now.”
Tuesday, February 26, 2008 12
Step 1 – The Team
•  Be a software engineer
•  Train your skills
•  Study OO principles
•  Consider Zend Certification
Tuesday, February 26, 2008 13
Step 2 - Requirements
•  What does the customer need?
•  What do visitors want?
Tuesday, February 26, 2008 14
Step 2 - Requirements
•  Functional Design
  Requirements definition
  Interaction Design /
Wireframes
  Flow diagrams
Tuesday, February 26, 2008 15
Step 3 - Architecture
•  Don’t just start stacking bricks
•  Create an architecture first
Tuesday, February 26, 2008 16
Step 3 - Architecture
•  Technical Design
  Modelling
•  Class diagrams
•  ER diagram (data model)‫‏‬
•  Colaboration diagrams
•  Use cases
•  etc.
  Tools: UML, whiteboards
Tuesday, February 26, 2008 17
Step 3 - Architecture
•  High Level Architectures:
  MVC (Model View Controller)
  SOA (Service Oriented Architecture)
  Multi-tier development (Frontend, Application, Data)
  CBD (Component Based Development)‫‏‬
Tuesday, February 26, 2008 18
Step 4 - Tools
•  You don’t need tools...
•  But they make you productive
Tuesday, February 26, 2008 19
Step 4 - Tools
•  Development:
  Eclipse (PDT)‫‏‬
  PhpED
  Vim
  Zend Studio
  Komodo
•  IDE's vs Editors
  Debugging
  Profiling
  Navigation / cross references
  Syntax Checking
Tuesday, February 26, 2008 20
Step 4 - Tools
•  Source Control
  CVS / SVN
  Bitkeeper / GIT
  Branching
  Tagging
Tuesday, February 26, 2008 21
Step 5 - Foundation
•  Start stacking bricks?
  How many bricks does it take..
  What about stability?
•  Start with a foundation
Tuesday, February 26, 2008 22
Step 5 - Foundation
•  Use a framework
  Provides guidelines (frame)‫‏‬
  Off the shelf components
•  Examples
  Zend Framework http://framework.zend.com
  CakePHP http://http://www.cakephp.org
  ezComponents http://ez.no/ezcomponents
  Symfony http://www.symfony-project.org
  ATK http://www.achievo.org/atk
Tuesday, February 26, 2008 23
Step 5 - Foundation
•  The “Not Invented Here” Syndrome
  “The existing frameworks are no good.
I can do this better.”
  “This framework is no good.
It can do A through Y but I need Z.”
  “This framework is too big.
It provides A-Z but we only need A and B.”
  “I know there's a good framework.
But I would like to learn.”
Tuesday, February 26, 2008 24
Step 6 – Design Patterns
Requirement 1056.4:
We need to be able to look outside, but we
can't make holes in the wall (rain should be
kept outside). When it's sunny, a hole is ok.
Tuesday, February 26, 2008 25
Step 6 – Design Patterns
•  A ‘window’ is a concept
  Best practice way of solving a particular problem
•  In IT, we call this a ‘design pattern’
•  Popular patterns in PHP:
  MVC, Factory, Singleton, Registry, Decorator
•  Good read:
  php|architect's Guide to
PHP Design Patterns
- Jason E. Sweat
Tuesday, February 26, 2008 26
Step 7 - Testing
•  Is your software tested after it has gone live?
Tuesday, February 26, 2008 27
Step 7 - Testing
•  Various types of testing
  Developer testing
  Functional testing
  Environment testing
  Performance testing
  Usability testing
Tuesday, February 26, 2008 28
Step 7 - Testing
•  Common scenario
Tuesday, February 26, 2008 29
Step 7 - Testing
•  User complains...
MWOEHA!
BUG!
Tuesday, February 26, 2008 30
Step 7 - Testing
•  Developer attacks the problem
fix_bug();
Tuesday, February 26, 2008 31
Step 7 - Testing
•  Problem solved!
Tuesday, February 26, 2008 32
Step 7 - Testing
•  Solution: Unit Tests
  Automated testing after each change
  Prevents regressions
•  Testing for PHP applications:
  PHPUnit http://www.phpunit.de/
  SimpleTest http://www.lastcraft.com/simple_test.php
•  Continuous Integration:
  CruiseControl with phpUnderControl
  Xinc http://code.google.com/p/xinc/
Tuesday, February 26, 2008 33
Step 7 - Testing
•  Test Driven Development
1. Define functionality
2. Create testcase
3. Run test -> test fails
4. Implement functionality
•  Test succeeds? Done
•  Test fails? Refactor
Repeat step 4 until finished
Tuesday, February 26, 2008 34
Step 8 - Optimization
Users are reporting:
"I work on the 197th floor. Every day I
have to walk the stairs for 2 hours, then I
have only 4 hours left to do my job."
Tuesday, February 26, 2008 35
Step 8 - Optimization
•  Solution: Elevator
Tuesday, February 26, 2008 36
Step 8 - Optimization
In PHP, this ‘elevator’ is called an ‘accelerator’
  This is how PHP works (pseudo-ish code):
read index.php; // enter the building
compile index.php; // go to floor 197
echo “Hello World”; // get the job done
  An accelerator improves the first 2 steps
  Accelerators for PHP:
•  eAccelerator http://eaccelerator.net/
•  APC http://pecl.php.net/package/APC
•  Zend Platform http://www.zend.com/products/zend_platform
Tuesday, February 26, 2008 37
Step 8 - Optimization
Users complain:
“Every time I need coffee I have to go
to the top floor to get some.”
Tuesday, February 26, 2008 38
Step 8 - Optimization
•  Solution: Create small coffee corners on every floor so
people
d
o
n’t have to go to the main restaurant every time.
•  In PHP we call this caching
  Don’t query the database everytime you need data
  Use locally stored copy (file or memory)‫‏‬
•  PHP Caching solutions:
  Zend_Cache http://framework.zend.com
  Smarty http://smarty.php.net
  Zend Platform http://www.zend.com/products/zend_platform
  Memcached http://danga.com/memcached/
Tuesday, February 26, 2008 39
Step 9 - Deployment
•  Lifecycle:
  Develop
  Test
  Deploy to acceptance test environment
  Deploy to live
•  Use SVN
•  Code is just a part, don't forget the database
•  Create a 'Deployment & Release Profile'
Tuesday, February 26, 2008 40
Step 9 - Deployment
•  System Architecture
PHP
Apache
Linux
MySQL
From a simple LAMP stack on a single machine...
Tuesday, February 26, 2008 41
Step 9 - Deployment
•  System Architecture
... to a High Availability, Horizontally Scalable architecture
Tuesday, February 26, 2008 42
Step 10 - Operations
•  Monitoring
  Logfiles
  Monitor infrastructure (tools such as Nagios)‫‏‬
  Monitor application (tools such as Zend Platform)‫‏‬
  Monitor business (is the money still pouring in?)
Tuesday, February 26, 2008 43
Step 10 - Operations
•  Debugging
  Ideal:
“I had error x when I selected y after I clicked z”
  Reality:
“It doesn't work!”
“What exactly doesn't work, and what did you do?”
“It just ******** didn't work, FIX IT.”
Tuesday, February 26, 2008 44
Step 10 - Operations
•  Solution
  A 'root cause
analysis' tool
Tuesday, February 26, 2008 45
Step 10 - Operations
•  Change management
  Ticket system
  Stick to your deployment - use the DRP
  DON'T TOUCH THE LIVE ENVIRONMENT.
  But I absolutely have to...
DON'T!
  but...
NO! IF YOU TOUCH IT, YOU WILL LOSE ALL GURU POINTS.
46
Shameless self-promotion
•  php|architect's
Guide to Enterprise PHP Development
•  PDF: June 12, Print: June 26
•  ISBN: 978-0-9738621-8-8
•  Order via http://phparch.com
•  http://www.enterprisephp.nl
Ibuildings - http://www.ibuildings.com
Questions?
http://www.jansch.nl
http://www.enterprisephp.nl
http://www.ibuildings.com
ivo@ibuildings.com

More Related Content

PPTX
Unit Testing - Calgary .NET User Group - Nov 26 2014 - Depth Consulting
PDF
Tips for Building your First XPages Java Application
PPTX
Panopoly - Boulder DBUG 13 Nov 2013
PDF
Automation Abstractions: Page Objects and Beyond
PPTX
ProtractorJS for automated testing of Angular 1.x/2.x applications
PDF
Enterprise PHP Development (Dutch PHP Conference 2008)
ZIP
Using Features
PDF
FreshAir2008
Unit Testing - Calgary .NET User Group - Nov 26 2014 - Depth Consulting
Tips for Building your First XPages Java Application
Panopoly - Boulder DBUG 13 Nov 2013
Automation Abstractions: Page Objects and Beyond
ProtractorJS for automated testing of Angular 1.x/2.x applications
Enterprise PHP Development (Dutch PHP Conference 2008)
Using Features
FreshAir2008

What's hot (18)

PDF
Abstraction Layers Test Management Summit Faciliated Session 2014
PDF
Expert selenium with core java
PPT
Testing Java Web Apps With Selenium
PPTX
Automate testing with behat, selenium, phantom js and nightwatch.js (5)
PDF
Workshop - E2e tests with protractor
PPTX
Challenges in test automation for web apps
PDF
Getting By Without "QA"
PPTX
Out of box page object design pattern, java
PPTX
Basic Selenium Training
PDF
Mastering UI automation at Scale: Key Lessons and Best Practices (By Fernando...
PPTX
Как стать синьором
PDF
Better Page Object Handling with Loadable Component Pattern
PDF
JS Module Server
PPTX
Increase selenium tests stability via java script
PPTX
WordPress Security and Best Practices
PDF
Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.
PDF
Protractor: Tips & Tricks
PDF
Foundation selenium java
Abstraction Layers Test Management Summit Faciliated Session 2014
Expert selenium with core java
Testing Java Web Apps With Selenium
Automate testing with behat, selenium, phantom js and nightwatch.js (5)
Workshop - E2e tests with protractor
Challenges in test automation for web apps
Getting By Without "QA"
Out of box page object design pattern, java
Basic Selenium Training
Mastering UI automation at Scale: Key Lessons and Best Practices (By Fernando...
Как стать синьором
Better Page Object Handling with Loadable Component Pattern
JS Module Server
Increase selenium tests stability via java script
WordPress Security and Best Practices
Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.
Protractor: Tips & Tricks
Foundation selenium java
Ad

Similar to Enterprise PHP Development - Ivo Jansch (20)

PPT
Enterprise PHP (PHP London Conference 2008)
PPT
Enterprise PHP (Zend UK Business Conference)
PDF
Enterprise PHP Development - ZendCon 2008
PDF
Phpworks enterprise-php-1227605806710884-9
PDF
Enterprise PHP (php|works 2008)
PPT
Software Engineering in PHP
PDF
Enterprise PHP
PPT
Introduction to PHP (Casino Affiliate Convention 2008)
PDF
PHP in the Real World
PPTX
Enterprise Development on a Shoestring Budget
PDF
Migrating from PHP4 To PHP5 - Zend Webinar
PPT
Make Web, Not War - Building Interoperable Web Apps with PHP, PHP Quebec
PDF
30 Skills to Master to Become a Senior Software Engineer
PDF
Best Practices with Zend Framework - Matthew Weier O'Phinney
 
PPTX
North east user group tour
ZIP
Epitech industrialisation 2012.key
KEY
Confoo
PPT
How to run an Enterprise PHP Shop
PDF
Professional PHP: an open-source alternative for enterprise development [Kort...
PPTX
Developing apps faster
Enterprise PHP (PHP London Conference 2008)
Enterprise PHP (Zend UK Business Conference)
Enterprise PHP Development - ZendCon 2008
Phpworks enterprise-php-1227605806710884-9
Enterprise PHP (php|works 2008)
Software Engineering in PHP
Enterprise PHP
Introduction to PHP (Casino Affiliate Convention 2008)
PHP in the Real World
Enterprise Development on a Shoestring Budget
Migrating from PHP4 To PHP5 - Zend Webinar
Make Web, Not War - Building Interoperable Web Apps with PHP, PHP Quebec
30 Skills to Master to Become a Senior Software Engineer
Best Practices with Zend Framework - Matthew Weier O'Phinney
 
North east user group tour
Epitech industrialisation 2012.key
Confoo
How to run an Enterprise PHP Shop
Professional PHP: an open-source alternative for enterprise development [Kort...
Developing apps faster
Ad

More from dpc (20)

PDF
ezComponents - Derick Rethans
 
PDF
Software And The Taste Of Mayo - Marco Tabini
 
PDF
Deployment With Subversion - Lorna Mitchell
 
PDF
State Of PHP - Zeev Suraski
 
PDF
Symfony 1.1 - Fabien Potencier
 
PDF
Advanced PHP: Design Patterns - Dennis-Jan Broerse
 
PDF
New Features PHPUnit 3.3 - Sebastian Bergmann
 
PDF
PHP 5.3 and PHP 6; a look ahead - Stefan Priebsch
 
PDF
Quality Assurance in PHP projects - Sebastian Bergmann
 
PDF
An Infrastructure for Team Development - Gaylord Aulke
 
PDF
DPC2008 Intro - Ivo Jansch
 
PPT
DPC 2007 My First Mashup (Cal Evans)
 
PDF
DPC2007 CodeGear, Delphi For PHP (Pawel Glowacki)
 
PDF
DPC2007 Zend Framework (Gaylord Aulke)
 
PDF
DPC2007 Objects Of Desire (Kevlin Henney)
 
PDF
DPC2007 Symfony (Stefan Koopmanschap)
 
PDF
DPC2007 PHP And Oracle (Kuassi Mensah)
 
PPT
DPC2007 Case Study Surfnet (Herman Van Dompseler)
 
PDF
DPC2007 Case Study Zoom & Webwereld (Sander vd Graaf)
 
PDF
DPC2007 PDO (Lukas Kahwe Smith)
 
ezComponents - Derick Rethans
 
Software And The Taste Of Mayo - Marco Tabini
 
Deployment With Subversion - Lorna Mitchell
 
State Of PHP - Zeev Suraski
 
Symfony 1.1 - Fabien Potencier
 
Advanced PHP: Design Patterns - Dennis-Jan Broerse
 
New Features PHPUnit 3.3 - Sebastian Bergmann
 
PHP 5.3 and PHP 6; a look ahead - Stefan Priebsch
 
Quality Assurance in PHP projects - Sebastian Bergmann
 
An Infrastructure for Team Development - Gaylord Aulke
 
DPC2008 Intro - Ivo Jansch
 
DPC 2007 My First Mashup (Cal Evans)
 
DPC2007 CodeGear, Delphi For PHP (Pawel Glowacki)
 
DPC2007 Zend Framework (Gaylord Aulke)
 
DPC2007 Objects Of Desire (Kevlin Henney)
 
DPC2007 Symfony (Stefan Koopmanschap)
 
DPC2007 PHP And Oracle (Kuassi Mensah)
 
DPC2007 Case Study Surfnet (Herman Van Dompseler)
 
DPC2007 Case Study Zoom & Webwereld (Sander vd Graaf)
 
DPC2007 PDO (Lukas Kahwe Smith)
 

Recently uploaded (20)

PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Empathic Computing: Creating Shared Understanding
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Electronic commerce courselecture one. Pdf
PDF
Approach and Philosophy of On baking technology
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Encapsulation theory and applications.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Machine learning based COVID-19 study performance prediction
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Network Security Unit 5.pdf for BCA BBA.
Dropbox Q2 2025 Financial Results & Investor Presentation
Unlocking AI with Model Context Protocol (MCP)
Empathic Computing: Creating Shared Understanding
Advanced methodologies resolving dimensionality complications for autism neur...
Electronic commerce courselecture one. Pdf
Approach and Philosophy of On baking technology
Reach Out and Touch Someone: Haptics and Empathic Computing
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
MYSQL Presentation for SQL database connectivity
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Encapsulation theory and applications.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
sap open course for s4hana steps from ECC to s4
Diabetes mellitus diagnosis method based random forest with bat algorithm
Understanding_Digital_Forensics_Presentation.pptx
Machine learning based COVID-19 study performance prediction
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf

Enterprise PHP Development - Ivo Jansch

  • 1. Ibuildings - http://www.ibuildings.com Enterprise PHP development Ivo Jansch <ivo@ibuildings.com> Dutch PHP Conference, June 14, 2008
  • 2. Tuesday, February 26, 2008 2 What's an enterprise? •  Wikipedia:   “Any of several ships by that name in the Star Trek fictional universe”   “A business, company, or comparable organization”
  • 3. Tuesday, February 26, 2008 3 Is PHP Enterprise ready? •  CIO Magazine: “PHPworkswellforprototypingbecauseitiseasytogetasiteupandrunning.UsePHPtodesign the site [...] but when it comes time for development, tell the team you want t he result to look and act like this PHP site...but in Java” (Or: “great, this is exactly what I need! now do it again, at twice the cost!”)‫‏‬ http://www.cio.com/article/176250 (skip the article, read the comments)‫‏‬
  • 4. Tuesday, February 26, 2008 4 Is PHP Enterprise ready?  Small  Lightweight  Cheap  Easy to learn  Big  Enterprise friendly  enterpriCe  CS required
  • 5. Tuesday, February 26, 2008 5 A word from my girlfriend It's not the SIZE of the tool... It's how you USE it.
  • 6. Tuesday, February 26, 2008 6 PHP is changing... •  1998   Personal stuff •  2003   Simple websites   Content management   Blogs •  2008   Big websites   Banks   Insurance Companies   ...
  • 7. Tuesday, February 26, 2008 7 PHP is changing... •  Traditional metaphor   PHP is like Lego bricks   Bricks allowing you to build anything
  • 8. Tuesday, February 26, 2008 8 PHP is changing... •  PHP is no longer a toy   Let’s use the metaphor of actual bricks   Because we’re building actual buildings now
  • 9. Tuesday, February 26, 2008 9 About Bricks •  Extreme simplicity •  Easy to learn •  Versatile •  Cheap ... so building a skyscraper must be peanuts, right?
  • 11. Tuesday, February 26, 2008 11 Step 1 – The Team “Dear Mr. Businessman, I have read about your plans to build a new skyscraper and I am applying for a job. I have a lot of experience with Bricks. I taught myself how to use them and have been maintaining our family shed for a few years now.”
  • 12. Tuesday, February 26, 2008 12 Step 1 – The Team •  Be a software engineer •  Train your skills •  Study OO principles •  Consider Zend Certification
  • 13. Tuesday, February 26, 2008 13 Step 2 - Requirements •  What does the customer need? •  What do visitors want?
  • 14. Tuesday, February 26, 2008 14 Step 2 - Requirements •  Functional Design   Requirements definition   Interaction Design / Wireframes   Flow diagrams
  • 15. Tuesday, February 26, 2008 15 Step 3 - Architecture •  Don’t just start stacking bricks •  Create an architecture first
  • 16. Tuesday, February 26, 2008 16 Step 3 - Architecture •  Technical Design   Modelling •  Class diagrams •  ER diagram (data model)‫‏‬ •  Colaboration diagrams •  Use cases •  etc.   Tools: UML, whiteboards
  • 17. Tuesday, February 26, 2008 17 Step 3 - Architecture •  High Level Architectures:   MVC (Model View Controller)   SOA (Service Oriented Architecture)   Multi-tier development (Frontend, Application, Data)   CBD (Component Based Development)‫‏‬
  • 18. Tuesday, February 26, 2008 18 Step 4 - Tools •  You don’t need tools... •  But they make you productive
  • 19. Tuesday, February 26, 2008 19 Step 4 - Tools •  Development:   Eclipse (PDT)‫‏‬   PhpED   Vim   Zend Studio   Komodo •  IDE's vs Editors   Debugging   Profiling   Navigation / cross references   Syntax Checking
  • 20. Tuesday, February 26, 2008 20 Step 4 - Tools •  Source Control   CVS / SVN   Bitkeeper / GIT   Branching   Tagging
  • 21. Tuesday, February 26, 2008 21 Step 5 - Foundation •  Start stacking bricks?   How many bricks does it take..   What about stability? •  Start with a foundation
  • 22. Tuesday, February 26, 2008 22 Step 5 - Foundation •  Use a framework   Provides guidelines (frame)‫‏‬   Off the shelf components •  Examples   Zend Framework http://framework.zend.com   CakePHP http://http://www.cakephp.org   ezComponents http://ez.no/ezcomponents   Symfony http://www.symfony-project.org   ATK http://www.achievo.org/atk
  • 23. Tuesday, February 26, 2008 23 Step 5 - Foundation •  The “Not Invented Here” Syndrome   “The existing frameworks are no good. I can do this better.”   “This framework is no good. It can do A through Y but I need Z.”   “This framework is too big. It provides A-Z but we only need A and B.”   “I know there's a good framework. But I would like to learn.”
  • 24. Tuesday, February 26, 2008 24 Step 6 – Design Patterns Requirement 1056.4: We need to be able to look outside, but we can't make holes in the wall (rain should be kept outside). When it's sunny, a hole is ok.
  • 25. Tuesday, February 26, 2008 25 Step 6 – Design Patterns •  A ‘window’ is a concept   Best practice way of solving a particular problem •  In IT, we call this a ‘design pattern’ •  Popular patterns in PHP:   MVC, Factory, Singleton, Registry, Decorator •  Good read:   php|architect's Guide to PHP Design Patterns - Jason E. Sweat
  • 26. Tuesday, February 26, 2008 26 Step 7 - Testing •  Is your software tested after it has gone live?
  • 27. Tuesday, February 26, 2008 27 Step 7 - Testing •  Various types of testing   Developer testing   Functional testing   Environment testing   Performance testing   Usability testing
  • 28. Tuesday, February 26, 2008 28 Step 7 - Testing •  Common scenario
  • 29. Tuesday, February 26, 2008 29 Step 7 - Testing •  User complains... MWOEHA! BUG!
  • 30. Tuesday, February 26, 2008 30 Step 7 - Testing •  Developer attacks the problem fix_bug();
  • 31. Tuesday, February 26, 2008 31 Step 7 - Testing •  Problem solved!
  • 32. Tuesday, February 26, 2008 32 Step 7 - Testing •  Solution: Unit Tests   Automated testing after each change   Prevents regressions •  Testing for PHP applications:   PHPUnit http://www.phpunit.de/   SimpleTest http://www.lastcraft.com/simple_test.php •  Continuous Integration:   CruiseControl with phpUnderControl   Xinc http://code.google.com/p/xinc/
  • 33. Tuesday, February 26, 2008 33 Step 7 - Testing •  Test Driven Development 1. Define functionality 2. Create testcase 3. Run test -> test fails 4. Implement functionality •  Test succeeds? Done •  Test fails? Refactor Repeat step 4 until finished
  • 34. Tuesday, February 26, 2008 34 Step 8 - Optimization Users are reporting: "I work on the 197th floor. Every day I have to walk the stairs for 2 hours, then I have only 4 hours left to do my job."
  • 35. Tuesday, February 26, 2008 35 Step 8 - Optimization •  Solution: Elevator
  • 36. Tuesday, February 26, 2008 36 Step 8 - Optimization In PHP, this ‘elevator’ is called an ‘accelerator’   This is how PHP works (pseudo-ish code): read index.php; // enter the building compile index.php; // go to floor 197 echo “Hello World”; // get the job done   An accelerator improves the first 2 steps   Accelerators for PHP: •  eAccelerator http://eaccelerator.net/ •  APC http://pecl.php.net/package/APC •  Zend Platform http://www.zend.com/products/zend_platform
  • 37. Tuesday, February 26, 2008 37 Step 8 - Optimization Users complain: “Every time I need coffee I have to go to the top floor to get some.”
  • 38. Tuesday, February 26, 2008 38 Step 8 - Optimization •  Solution: Create small coffee corners on every floor so people d o n’t have to go to the main restaurant every time. •  In PHP we call this caching   Don’t query the database everytime you need data   Use locally stored copy (file or memory)‫‏‬ •  PHP Caching solutions:   Zend_Cache http://framework.zend.com   Smarty http://smarty.php.net   Zend Platform http://www.zend.com/products/zend_platform   Memcached http://danga.com/memcached/
  • 39. Tuesday, February 26, 2008 39 Step 9 - Deployment •  Lifecycle:   Develop   Test   Deploy to acceptance test environment   Deploy to live •  Use SVN •  Code is just a part, don't forget the database •  Create a 'Deployment & Release Profile'
  • 40. Tuesday, February 26, 2008 40 Step 9 - Deployment •  System Architecture PHP Apache Linux MySQL From a simple LAMP stack on a single machine...
  • 41. Tuesday, February 26, 2008 41 Step 9 - Deployment •  System Architecture ... to a High Availability, Horizontally Scalable architecture
  • 42. Tuesday, February 26, 2008 42 Step 10 - Operations •  Monitoring   Logfiles   Monitor infrastructure (tools such as Nagios)‫‏‬   Monitor application (tools such as Zend Platform)‫‏‬   Monitor business (is the money still pouring in?)
  • 43. Tuesday, February 26, 2008 43 Step 10 - Operations •  Debugging   Ideal: “I had error x when I selected y after I clicked z”   Reality: “It doesn't work!” “What exactly doesn't work, and what did you do?” “It just ******** didn't work, FIX IT.”
  • 44. Tuesday, February 26, 2008 44 Step 10 - Operations •  Solution   A 'root cause analysis' tool
  • 45. Tuesday, February 26, 2008 45 Step 10 - Operations •  Change management   Ticket system   Stick to your deployment - use the DRP   DON'T TOUCH THE LIVE ENVIRONMENT.   But I absolutely have to... DON'T!   but... NO! IF YOU TOUCH IT, YOU WILL LOSE ALL GURU POINTS.
  • 46. 46 Shameless self-promotion •  php|architect's Guide to Enterprise PHP Development •  PDF: June 12, Print: June 26 •  ISBN: 978-0-9738621-8-8 •  Order via http://phparch.com •  http://www.enterprisephp.nl