SlideShare a Scribd company logo
1 of 40
Download to read offline
Software Engineering
                                In PHP
                            V1.0 - Prepared for Austin PHP
                                       http://php.meetup.com/42/


                                Ralph Schindler - Zend
                               http://ralphschindler.com | http://zend.com
                                   Josh Butts - Vertive
                                http://joshbutts.com | http://vertive.com


Wednesday, May 13, 2009                                                      1
General Purpose
                   •      These slides are for:

                          •   Software “developers” with an interest in
                              becoming software “engineers”

                          •   Engineers in other disciplines (Java, .NET, C#)
                              that want to draw parallels to PHP

                   •      These slides are:

                          •   An overview only, a means to pique interest

                          •   More information can be found in the linked
                              provided with each slide

Wednesday, May 13, 2009                                                         2
Contents

                   • Programming Languages
                   • Design Patterns
                   • Software Development & Best Practices
                   • PHP Ecosystem

Wednesday, May 13, 2009                                      3
Programming Languages
                          Language Features & Paradigms




Wednesday, May 13, 2009                                   4
Programming Languages

                                 Paradigms
                   • Imperative vs. Declarative
                   • Object Oriented
                    • Class / Inheritance
                    • Prototype based
                   • Procedural
                                http://en.wikipedia.org/wiki/Programming_paradigms
                               http://en.wikipedia.org/wiki/Imperative_programming
                               http://en.wikipedia.org/wiki/Declarative_programming
                            http://en.wikipedia.org/wiki/Object-oriented_programming
                              http://en.wikipedia.org/wiki/Class-based_programming
                            http://en.wikipedia.org/wiki/Prototype-based_programming
                               http://en.wikipedia.org/wiki/Procedural_programming


Wednesday, May 13, 2009                                                                5
Programming Languages

                                    Typing

                   • Static vs. Dynamic
                   • Strong vs. Weak
                   • Duck Typing

                                http://en.wikipedia.org/wiki/Type_system




Wednesday, May 13, 2009                                                    6
Programming Languages

                    Compiled vs. Scripting
                   • Compiled (machine code)
                    • c, c++
                   • Compiled (byte-code)
                    • Java, C# (.net)
                   • Scripting
                    • PHP, Ruby, Python, ECMAScript (Java /
                       Action)
                                 http://en.wikipedia.org/wiki/Scripting_language
                                http://en.wikipedia.org/wiki/Compiled_language
                                  http://en.wikipedia.org/wiki/Virtual_machine
                              http://en.wikipedia.org/wiki/Just-in-time_compilation



Wednesday, May 13, 2009                                                               7
Programming Languages

                                             PHP
                          • Scripting Language
                           • Virtual Machine: Zend Engine
                             • Written in C
                          • Multi-paradigm
                           • Imperative (procedural)
                           • Object-oriented (inheritance)
                           • Weak dynamic typing
                                    http://en.wikipedia.org/wiki/Zend_Engine
                                         http://en.wikipedia.org/wiki/PHP




Wednesday, May 13, 2009                                                        8
Design Patterns
                           Building Blocks for Software




Wednesday, May 13, 2009                                   9
Design Patterns

                                     Overview
                   • Applications
                    • Model 1
                    • Model 2
                   • Programming Patterns
                   • Architectural Patterns
                                            http://en.wikipedia.org/wiki/Model_1
                                            http://en.wikipedia.org/wiki/Model_2
                             http://en.wikipedia.org/wiki/Design_pattern_(computer_science)
                          http://en.wikipedia.org/wiki/Architectural_pattern_(computer_science)



Wednesday, May 13, 2009                                                                           10
Design Patterns

                          Model 1 vs. Model 2
                   • Coined in the Java world
                   • Model 1 apps are procedural applications
                    • TypicallyJSP pagesa series of scripts,
                                built as
                       original
                   • Model 2 apps arehave separation of and/or
                                        tiered applications
                     applications that
                          concerns

                                                http://en.wikipedia.org/wiki/Model_1
                                                http://en.wikipedia.org/wiki/Model_2
                                        http://en.wikipedia.org/wiki/Separation_of_concern
                              http://en.wikipedia.org/wiki/Separation_of_presentation_and_content



Wednesday, May 13, 2009                                                                             11
Design Patterns

                    Programming Patterns

                   • Most notable source: Gang
                     of Four
                   • Object oriented design
                     patterns



                                             http://en.wikipedia.org/wiki/Design_Patterns_(book)
                    http://www.amazon.com/Design-Patterns-Object-Oriented-Addison-Wesley-Professional/dp/0201633612/
                                      http://en.wikipedia.org/wiki/Design_pattern_(computer_science)




Wednesday, May 13, 2009                                                                                                12
Design Patterns / Software Patterns

                          Example: Factory




                            http://en.wikipedia.org/wiki/Factory_method_pattern
                               http://en.wikipedia.org/wiki/Creational_pattern




Wednesday, May 13, 2009                                                           13
Design Patterns / Software Patterns

                    Example: Lazy Loading




                          http://en.wikipedia.org/wiki/Lazy_initialization_pattern




Wednesday, May 13, 2009                                                              14
Design Patterns / Software Patterns

                          Example: Singleton




                              http://en.wikipedia.org/wiki/Singleton_pattern




Wednesday, May 13, 2009                                                        15
Design Patterns / Software Patterns

                          Example: Composite


                                     http://en.wikipedia.org/wiki/Composite_pattern
                                         http://devzone.zend.com/node/view/id/7




Wednesday, May 13, 2009                                                               16
Design Patterns / Software Patterns

                          Example: Adapter

                                        http://en.wikipedia.org/wiki/Adapter_pattern




Wednesday, May 13, 2009                                                                17
Design Patterns / Software Patterns

                          Example: Observer
                                        http://en.wikipedia.org/wiki/Observer_pattern
                                            http://www.php.net/~helly/php/ext/spl/




Wednesday, May 13, 2009                                                            18
Design Patterns

                    Programming Patterns

                   • Most notable source:
                     Martin Fowler
                   • PoEAA: Patterns of
                     Enterprise Application
                          Architecture



                                   http://en.wikipedia.org/wiki/Architectural_pattern_(computer_science)
                                                     http://martinfowler.com/eaaCatalog/
                    http://www.amazon.com/Enterprise-Application-Architecture-Addison-Wesley-Signature/dp/0321127420/




Wednesday, May 13, 2009                                                                                                 19
Design Patterns / Architectural Patterns

                             Non-PoEAA
                   • Presentation-abstraction-control
                   • Service-oriented architecture (distributed)
                   • Mulit/Three-Tier
                   • Peer-to-Peer (distributed)
                            http://en.wikipedia.org/wiki/Presentation-abstraction-control
                             http://en.wikipedia.org/wiki/Service-oriented_architecture
                                 http://en.wikipedia.org/wiki/Three-tier_(computing)
                                       http://en.wikipedia.org/wiki/Peer-to-peer



Wednesday, May 13, 2009                                                                     20
Design Patterns / Architectural Patterns

                                           PoEAA
                   • Logical: Domain Model & Table Module
                   • Data: Table Row & Row Data Gateway,
                          ActiveRecord, Data Mapper
                   • Other:
                    • Repository, Registry, Plugin
                    • Model-View-Controller, Front
                           Controller, Two-step View
                                         http://martinfowler.com/eaaCatalog/
                                 http://en.wikipedia.org/wiki/Active_record_pattern



Wednesday, May 13, 2009                                                               21
Design Patterns / Architectural Patterns

              Example: Domain Model
                                             http://en.wikipedia.org/wiki/Domain_Model

                                             http://martinfowler.com/eaaCatalog/
                                             domainModel.html




Wednesday, May 13, 2009                                                             22
Design Patterns / Architectural Patterns

                   Example: Table Module

                                        http://martinfowler.com/eaaCatalog/
                                        tableModule.html




Wednesday, May 13, 2009                                                       23
Design Patterns / Architectural Patterns

               Example: Table Gateway

                                http://martinfowler.com/eaaCatalog/tableDataGateway.html




Wednesday, May 13, 2009                                                                    24
Design Patterns / Architectural Patterns

                Example: Row Gateway

                                http://martinfowler.com/eaaCatalog/rowDataGateway.html




Wednesday, May 13, 2009                                                                  25
Design Patterns / Architectural Patterns

                Example: Active Record

                                http://martinfowler.com/eaaCatalog/activeRecord.html

                                http://en.wikipedia.org/wiki/Active_record_pattern




Wednesday, May 13, 2009                                                                26
Design Patterns / Architectural Patterns

                Example: Active Record

                                http://martinfowler.com/eaaCatalog/activeRecord.html

                                http://en.wikipedia.org/wiki/Active_record_pattern




Wednesday, May 13, 2009                                                                27
Design Patterns / Architectural Patterns

                          Example: MVC

                              http://en.wikipedia.org/wiki/Model-view-controller

                              http://martinfowler.com/eaaCatalog/modelViewController.html




Wednesday, May 13, 2009                                                                     28
Design Patterns / Architectural Patterns

                          Example: Registry

                                   http://martinfowler.com/eaaCatalog/registry.html




Wednesday, May 13, 2009                                                               29
Software Development
                        Process
                          Best Practices for Building Software




Wednesday, May 13, 2009                                          30
Development Process

                                  Overview

               • Unit Testing
               • Source Control
               • Coding Standards
               • Continuous Integration
               • Documentation
                                 http://en.wikipedia.org/wiki/Programming_style
                          http://martinfowler.com/articles/continuousIntegration.html
                                    http://en.wikipedia.org/wiki/Unit_testing
                                  http://en.wikipedia.org/wiki/Revision_control

Wednesday, May 13, 2009                                                                 31
Development Process

                                 Unit Testing
               • Why write unit tests?
                • prevent regressions
                • ensure software meets requirements
                • tests help document what the software
                          does
               • XUnit pattern
                                  http://en.wikipedia.org/wiki/XUnit



Wednesday, May 13, 2009                                                32
Development Process

                              Source Control
               • Why use source control?
                • Keep track of changes you made
                • Light-weight backup
                • Great for collaboration, even if there is only
                          one of you now
               • Common SCM (Source Code Management)
                      tools
                                                http://subversion.tigris.org/
                                                    http://git-scm.com/
                                                  http://www.github.com
                                http://en.wikipedia.org/wiki/Distributed_revision_control

Wednesday, May 13, 2009                                                                     33
Development Process

                            Coding Standards
               • Why have coding standards?
                • readability for yourself and colleagues
                • prevents mistakes, syntax errors
               • Pear Coding Standards
                • don't write your own standards, its not
                          worth your time
                                 http://pear.php.net/pepr/pepr-proposal-show.php?id=426
                                        http://pear.php.net/manual/en/standards.php
                               http://framework.zend.com/manual/en/coding-standard.html

Wednesday, May 13, 2009                                                                   34
Development Process

                           Build & Deploy
               • Create a testable and repeatable deployment
                      process
                   • Run some functional tests
                   • document your application
                    • Code comments
                    • API Docs
                                    http://cruisecontrol.sourceforge.net/
                                       http://code.google.com/p/xinc/
                                http://www.atlassian.com/software/bamboo/

Wednesday, May 13, 2009                                                     35
PHP Ecosystem
                             Software & Tools




Wednesday, May 13, 2009                         36
PHP Ecosystem
                                        Application
                                        Frameworks
               •       Application Framework

                   •      Zend Framework

                          •   toolkit / glue style: use what you want or use it all

                   •      CakePHP & CodeIgnitor

                          •   lightweight MVC frameworks with data models

                   •      Symfony

                          •   MVC, more admin and configuration features
                                                     http://framework.zend.com/
                                                        http://codeigniter.com/
                                                          http://cakephp.org/
                                                   http://www.symfony-project.org/
                                      http://en.wikipedia.org/wiki/Web_application_framework

Wednesday, May 13, 2009                                                                        37
PHP Ecosystem
                          Unit Testing
                          Frameworks
               • PHPUnit
                • Most popular, derived from NUnit pattern
               • Simpletest
               • phpt
                                    http://www.simpletest.org/
                                          http://phpt.info/
                            http://en.wikipedia.org/wiki/Unit_testing
                                      http://www.phpunit.de/

Wednesday, May 13, 2009                                                 38
PHP Ecosystem

                                   IDEs & Editors
               •       Editors

                   •      pattern matched syntax highlighting & code folding

                   •      typically multi-language

                   •      especially good at text & code manipulation

               •       IDEs

                   •      Language introspection (code completion)

                   •      Errors / Warnings / Syntax Check

                   •      Debugging capabilities (breakpoints, watches, profiling)


                                       http://en.wikipedia.org/wiki/Comparison_of_text_editors
                                  http://en.wikipedia.org/wiki/Integrated_development_environment
                                                        http://www.xdebug.org/

Wednesday, May 13, 2009                                                                             39
PHP Ecosystem

                                        IDEs & Editors
               •       Eclipse-based IDEs

                   •      Zend Studio (paid) / PDT (open source)

                          •      great PHP editing and debugging

                   •          Aptana

                          •      javascript & css editing & code completion is excellent

                          •      debugging with xdebug

               •       Text Editors

                   •      Ultraedit on Windows

                   •      Textmate on Mac

                          •      “E” is Textmate on Windows
                                                    http://www.zend.com/en/products/studio/
                                                            http://www.eclipse.org/pdt/
                                                             http://www.ultraedit.com/
                                                              http://www.aptana.com
                                                           http://www.macromates.com

Wednesday, May 13, 2009                                                                       40

More Related Content

Similar to Software Engineering In PHP

No Really, It's All About You
No Really, It's All About YouNo Really, It's All About You
No Really, It's All About YouChris Cornutt
 
Colin Clark Accessible U Is With J Query And Infusion[1]
Colin Clark Accessible U Is With J Query And Infusion[1]Colin Clark Accessible U Is With J Query And Infusion[1]
Colin Clark Accessible U Is With J Query And Infusion[1]Ajax Experience 2009
 
CouchDB to the Edge ApacheCon EU
CouchDB to the  Edge ApacheCon EUCouchDB to the  Edge ApacheCon EU
CouchDB to the Edge ApacheCon EUChris Anderson
 
JSUG - Maven by Michael Greifeneder
JSUG - Maven by Michael GreifenederJSUG - Maven by Michael Greifeneder
JSUG - Maven by Michael GreifenederChristoph Pickl
 
Mash-Up Personal Learning Environments (MUPPLE)
Mash-Up Personal Learning Environments (MUPPLE)Mash-Up Personal Learning Environments (MUPPLE)
Mash-Up Personal Learning Environments (MUPPLE)Hannes Ebner
 
Portlets
PortletsPortlets
Portletsssetem
 
Enterprise PHP (php|works 2008)
Enterprise PHP (php|works 2008)Enterprise PHP (php|works 2008)
Enterprise PHP (php|works 2008)Ivo Jansch
 
HTML5 Can't Do That
HTML5 Can't Do ThatHTML5 Can't Do That
HTML5 Can't Do ThatNathan Smith
 
Merb For The Enterprise
Merb For The EnterpriseMerb For The Enterprise
Merb For The EnterpriseMatt Aimonetti
 
iPhone Development For .Net Dev
iPhone Development For .Net DeviPhone Development For .Net Dev
iPhone Development For .Net DevAlex Hung
 
Introduction To Software Engineering
Introduction To Software EngineeringIntroduction To Software Engineering
Introduction To Software EngineeringLeyla Bonilla
 
Java And Community Support
Java And Community SupportJava And Community Support
Java And Community SupportWilliam Grosso
 
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory CourseRuby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Coursepeter_marklund
 
symfony: Open-Source Enterprise Framework
symfony: Open-Source Enterprise Frameworksymfony: Open-Source Enterprise Framework
symfony: Open-Source Enterprise FrameworkFabien Potencier
 
DEVIntersection 2014 iOS and Android Development for C# Developers
DEVIntersection 2014 iOS and Android Development for C# DevelopersDEVIntersection 2014 iOS and Android Development for C# Developers
DEVIntersection 2014 iOS and Android Development for C# DevelopersJames Montemagno
 

Similar to Software Engineering In PHP (20)

No Really, It's All About You
No Really, It's All About YouNo Really, It's All About You
No Really, It's All About You
 
Amoocon May 2009 Germany
Amoocon May 2009   GermanyAmoocon May 2009   Germany
Amoocon May 2009 Germany
 
Colin Clark Accessible U Is With J Query And Infusion[1]
Colin Clark Accessible U Is With J Query And Infusion[1]Colin Clark Accessible U Is With J Query And Infusion[1]
Colin Clark Accessible U Is With J Query And Infusion[1]
 
CouchDB to the Edge ApacheCon EU
CouchDB to the  Edge ApacheCon EUCouchDB to the  Edge ApacheCon EU
CouchDB to the Edge ApacheCon EU
 
JSUG - Maven by Michael Greifeneder
JSUG - Maven by Michael GreifenederJSUG - Maven by Michael Greifeneder
JSUG - Maven by Michael Greifeneder
 
Mash-Up Personal Learning Environments (MUPPLE)
Mash-Up Personal Learning Environments (MUPPLE)Mash-Up Personal Learning Environments (MUPPLE)
Mash-Up Personal Learning Environments (MUPPLE)
 
Portlets
PortletsPortlets
Portlets
 
software programs
software programssoftware programs
software programs
 
Becoming A Php Ninja
Becoming A Php NinjaBecoming A Php Ninja
Becoming A Php Ninja
 
Enterprise PHP (php|works 2008)
Enterprise PHP (php|works 2008)Enterprise PHP (php|works 2008)
Enterprise PHP (php|works 2008)
 
Developing Software That Matters I
Developing Software That Matters IDeveloping Software That Matters I
Developing Software That Matters I
 
Ch01 SE
Ch01 SECh01 SE
Ch01 SE
 
HTML5 Can't Do That
HTML5 Can't Do ThatHTML5 Can't Do That
HTML5 Can't Do That
 
Merb For The Enterprise
Merb For The EnterpriseMerb For The Enterprise
Merb For The Enterprise
 
iPhone Development For .Net Dev
iPhone Development For .Net DeviPhone Development For .Net Dev
iPhone Development For .Net Dev
 
Introduction To Software Engineering
Introduction To Software EngineeringIntroduction To Software Engineering
Introduction To Software Engineering
 
Java And Community Support
Java And Community SupportJava And Community Support
Java And Community Support
 
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory CourseRuby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Course
 
symfony: Open-Source Enterprise Framework
symfony: Open-Source Enterprise Frameworksymfony: Open-Source Enterprise Framework
symfony: Open-Source Enterprise Framework
 
DEVIntersection 2014 iOS and Android Development for C# Developers
DEVIntersection 2014 iOS and Android Development for C# DevelopersDEVIntersection 2014 iOS and Android Development for C# Developers
DEVIntersection 2014 iOS and Android Development for C# Developers
 

More from Ralph Schindler

Zend Framework 1 + Doctrine 2
Zend Framework 1 + Doctrine 2Zend Framework 1 + Doctrine 2
Zend Framework 1 + Doctrine 2Ralph Schindler
 
Extending ZF & Extending With ZF
Extending ZF & Extending With ZFExtending ZF & Extending With ZF
Extending ZF & Extending With ZFRalph Schindler
 
Zend_Tool In ZF 1.8 Webinar
Zend_Tool In ZF 1.8 WebinarZend_Tool In ZF 1.8 Webinar
Zend_Tool In ZF 1.8 WebinarRalph Schindler
 
Zend Framework 1.8 Features Webinar
Zend Framework 1.8 Features WebinarZend Framework 1.8 Features Webinar
Zend Framework 1.8 Features WebinarRalph Schindler
 
Zend_Layout & Zend_View Enhancements
Zend_Layout & Zend_View EnhancementsZend_Layout & Zend_View Enhancements
Zend_Layout & Zend_View EnhancementsRalph Schindler
 
Zend_Tool: Rapid Application Development with Zend Framework
Zend_Tool: Rapid Application Development with Zend FrameworkZend_Tool: Rapid Application Development with Zend Framework
Zend_Tool: Rapid Application Development with Zend FrameworkRalph Schindler
 

More from Ralph Schindler (12)

Zend Code in ZF 2.0
Zend Code in ZF 2.0Zend Code in ZF 2.0
Zend Code in ZF 2.0
 
Zend Di in ZF 2.0
Zend Di in ZF 2.0Zend Di in ZF 2.0
Zend Di in ZF 2.0
 
Zend Framework 1 + Doctrine 2
Zend Framework 1 + Doctrine 2Zend Framework 1 + Doctrine 2
Zend Framework 1 + Doctrine 2
 
484 Days of PHP 5.3
484 Days of PHP 5.3484 Days of PHP 5.3
484 Days of PHP 5.3
 
Modeling best practices
Modeling best practicesModeling best practices
Modeling best practices
 
What's New in ZF 1.10
What's New in ZF 1.10What's New in ZF 1.10
What's New in ZF 1.10
 
Extending ZF & Extending With ZF
Extending ZF & Extending With ZFExtending ZF & Extending With ZF
Extending ZF & Extending With ZF
 
Extending Zend_Tool
Extending Zend_ToolExtending Zend_Tool
Extending Zend_Tool
 
Zend_Tool In ZF 1.8 Webinar
Zend_Tool In ZF 1.8 WebinarZend_Tool In ZF 1.8 Webinar
Zend_Tool In ZF 1.8 Webinar
 
Zend Framework 1.8 Features Webinar
Zend Framework 1.8 Features WebinarZend Framework 1.8 Features Webinar
Zend Framework 1.8 Features Webinar
 
Zend_Layout & Zend_View Enhancements
Zend_Layout & Zend_View EnhancementsZend_Layout & Zend_View Enhancements
Zend_Layout & Zend_View Enhancements
 
Zend_Tool: Rapid Application Development with Zend Framework
Zend_Tool: Rapid Application Development with Zend FrameworkZend_Tool: Rapid Application Development with Zend Framework
Zend_Tool: Rapid Application Development with Zend Framework
 

Recently uploaded

Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
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
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
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
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
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
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
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
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
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
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbuapidays
 

Recently uploaded (20)

Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
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)
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
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
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
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?
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
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
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
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
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 

Software Engineering In PHP

  • 1. Software Engineering In PHP V1.0 - Prepared for Austin PHP http://php.meetup.com/42/ Ralph Schindler - Zend http://ralphschindler.com | http://zend.com Josh Butts - Vertive http://joshbutts.com | http://vertive.com Wednesday, May 13, 2009 1
  • 2. General Purpose • These slides are for: • Software “developers” with an interest in becoming software “engineers” • Engineers in other disciplines (Java, .NET, C#) that want to draw parallels to PHP • These slides are: • An overview only, a means to pique interest • More information can be found in the linked provided with each slide Wednesday, May 13, 2009 2
  • 3. Contents • Programming Languages • Design Patterns • Software Development & Best Practices • PHP Ecosystem Wednesday, May 13, 2009 3
  • 4. Programming Languages Language Features & Paradigms Wednesday, May 13, 2009 4
  • 5. Programming Languages Paradigms • Imperative vs. Declarative • Object Oriented • Class / Inheritance • Prototype based • Procedural http://en.wikipedia.org/wiki/Programming_paradigms http://en.wikipedia.org/wiki/Imperative_programming http://en.wikipedia.org/wiki/Declarative_programming http://en.wikipedia.org/wiki/Object-oriented_programming http://en.wikipedia.org/wiki/Class-based_programming http://en.wikipedia.org/wiki/Prototype-based_programming http://en.wikipedia.org/wiki/Procedural_programming Wednesday, May 13, 2009 5
  • 6. Programming Languages Typing • Static vs. Dynamic • Strong vs. Weak • Duck Typing http://en.wikipedia.org/wiki/Type_system Wednesday, May 13, 2009 6
  • 7. Programming Languages Compiled vs. Scripting • Compiled (machine code) • c, c++ • Compiled (byte-code) • Java, C# (.net) • Scripting • PHP, Ruby, Python, ECMAScript (Java / Action) http://en.wikipedia.org/wiki/Scripting_language http://en.wikipedia.org/wiki/Compiled_language http://en.wikipedia.org/wiki/Virtual_machine http://en.wikipedia.org/wiki/Just-in-time_compilation Wednesday, May 13, 2009 7
  • 8. Programming Languages PHP • Scripting Language • Virtual Machine: Zend Engine • Written in C • Multi-paradigm • Imperative (procedural) • Object-oriented (inheritance) • Weak dynamic typing http://en.wikipedia.org/wiki/Zend_Engine http://en.wikipedia.org/wiki/PHP Wednesday, May 13, 2009 8
  • 9. Design Patterns Building Blocks for Software Wednesday, May 13, 2009 9
  • 10. Design Patterns Overview • Applications • Model 1 • Model 2 • Programming Patterns • Architectural Patterns http://en.wikipedia.org/wiki/Model_1 http://en.wikipedia.org/wiki/Model_2 http://en.wikipedia.org/wiki/Design_pattern_(computer_science) http://en.wikipedia.org/wiki/Architectural_pattern_(computer_science) Wednesday, May 13, 2009 10
  • 11. Design Patterns Model 1 vs. Model 2 • Coined in the Java world • Model 1 apps are procedural applications • TypicallyJSP pagesa series of scripts, built as original • Model 2 apps arehave separation of and/or tiered applications applications that concerns http://en.wikipedia.org/wiki/Model_1 http://en.wikipedia.org/wiki/Model_2 http://en.wikipedia.org/wiki/Separation_of_concern http://en.wikipedia.org/wiki/Separation_of_presentation_and_content Wednesday, May 13, 2009 11
  • 12. Design Patterns Programming Patterns • Most notable source: Gang of Four • Object oriented design patterns http://en.wikipedia.org/wiki/Design_Patterns_(book) http://www.amazon.com/Design-Patterns-Object-Oriented-Addison-Wesley-Professional/dp/0201633612/ http://en.wikipedia.org/wiki/Design_pattern_(computer_science) Wednesday, May 13, 2009 12
  • 13. Design Patterns / Software Patterns Example: Factory http://en.wikipedia.org/wiki/Factory_method_pattern http://en.wikipedia.org/wiki/Creational_pattern Wednesday, May 13, 2009 13
  • 14. Design Patterns / Software Patterns Example: Lazy Loading http://en.wikipedia.org/wiki/Lazy_initialization_pattern Wednesday, May 13, 2009 14
  • 15. Design Patterns / Software Patterns Example: Singleton http://en.wikipedia.org/wiki/Singleton_pattern Wednesday, May 13, 2009 15
  • 16. Design Patterns / Software Patterns Example: Composite http://en.wikipedia.org/wiki/Composite_pattern http://devzone.zend.com/node/view/id/7 Wednesday, May 13, 2009 16
  • 17. Design Patterns / Software Patterns Example: Adapter http://en.wikipedia.org/wiki/Adapter_pattern Wednesday, May 13, 2009 17
  • 18. Design Patterns / Software Patterns Example: Observer http://en.wikipedia.org/wiki/Observer_pattern http://www.php.net/~helly/php/ext/spl/ Wednesday, May 13, 2009 18
  • 19. Design Patterns Programming Patterns • Most notable source: Martin Fowler • PoEAA: Patterns of Enterprise Application Architecture http://en.wikipedia.org/wiki/Architectural_pattern_(computer_science) http://martinfowler.com/eaaCatalog/ http://www.amazon.com/Enterprise-Application-Architecture-Addison-Wesley-Signature/dp/0321127420/ Wednesday, May 13, 2009 19
  • 20. Design Patterns / Architectural Patterns Non-PoEAA • Presentation-abstraction-control • Service-oriented architecture (distributed) • Mulit/Three-Tier • Peer-to-Peer (distributed) http://en.wikipedia.org/wiki/Presentation-abstraction-control http://en.wikipedia.org/wiki/Service-oriented_architecture http://en.wikipedia.org/wiki/Three-tier_(computing) http://en.wikipedia.org/wiki/Peer-to-peer Wednesday, May 13, 2009 20
  • 21. Design Patterns / Architectural Patterns PoEAA • Logical: Domain Model & Table Module • Data: Table Row & Row Data Gateway, ActiveRecord, Data Mapper • Other: • Repository, Registry, Plugin • Model-View-Controller, Front Controller, Two-step View http://martinfowler.com/eaaCatalog/ http://en.wikipedia.org/wiki/Active_record_pattern Wednesday, May 13, 2009 21
  • 22. Design Patterns / Architectural Patterns Example: Domain Model http://en.wikipedia.org/wiki/Domain_Model http://martinfowler.com/eaaCatalog/ domainModel.html Wednesday, May 13, 2009 22
  • 23. Design Patterns / Architectural Patterns Example: Table Module http://martinfowler.com/eaaCatalog/ tableModule.html Wednesday, May 13, 2009 23
  • 24. Design Patterns / Architectural Patterns Example: Table Gateway http://martinfowler.com/eaaCatalog/tableDataGateway.html Wednesday, May 13, 2009 24
  • 25. Design Patterns / Architectural Patterns Example: Row Gateway http://martinfowler.com/eaaCatalog/rowDataGateway.html Wednesday, May 13, 2009 25
  • 26. Design Patterns / Architectural Patterns Example: Active Record http://martinfowler.com/eaaCatalog/activeRecord.html http://en.wikipedia.org/wiki/Active_record_pattern Wednesday, May 13, 2009 26
  • 27. Design Patterns / Architectural Patterns Example: Active Record http://martinfowler.com/eaaCatalog/activeRecord.html http://en.wikipedia.org/wiki/Active_record_pattern Wednesday, May 13, 2009 27
  • 28. Design Patterns / Architectural Patterns Example: MVC http://en.wikipedia.org/wiki/Model-view-controller http://martinfowler.com/eaaCatalog/modelViewController.html Wednesday, May 13, 2009 28
  • 29. Design Patterns / Architectural Patterns Example: Registry http://martinfowler.com/eaaCatalog/registry.html Wednesday, May 13, 2009 29
  • 30. Software Development Process Best Practices for Building Software Wednesday, May 13, 2009 30
  • 31. Development Process Overview • Unit Testing • Source Control • Coding Standards • Continuous Integration • Documentation http://en.wikipedia.org/wiki/Programming_style http://martinfowler.com/articles/continuousIntegration.html http://en.wikipedia.org/wiki/Unit_testing http://en.wikipedia.org/wiki/Revision_control Wednesday, May 13, 2009 31
  • 32. Development Process Unit Testing • Why write unit tests? • prevent regressions • ensure software meets requirements • tests help document what the software does • XUnit pattern http://en.wikipedia.org/wiki/XUnit Wednesday, May 13, 2009 32
  • 33. Development Process Source Control • Why use source control? • Keep track of changes you made • Light-weight backup • Great for collaboration, even if there is only one of you now • Common SCM (Source Code Management) tools http://subversion.tigris.org/ http://git-scm.com/ http://www.github.com http://en.wikipedia.org/wiki/Distributed_revision_control Wednesday, May 13, 2009 33
  • 34. Development Process Coding Standards • Why have coding standards? • readability for yourself and colleagues • prevents mistakes, syntax errors • Pear Coding Standards • don't write your own standards, its not worth your time http://pear.php.net/pepr/pepr-proposal-show.php?id=426 http://pear.php.net/manual/en/standards.php http://framework.zend.com/manual/en/coding-standard.html Wednesday, May 13, 2009 34
  • 35. Development Process Build & Deploy • Create a testable and repeatable deployment process • Run some functional tests • document your application • Code comments • API Docs http://cruisecontrol.sourceforge.net/ http://code.google.com/p/xinc/ http://www.atlassian.com/software/bamboo/ Wednesday, May 13, 2009 35
  • 36. PHP Ecosystem Software & Tools Wednesday, May 13, 2009 36
  • 37. PHP Ecosystem Application Frameworks • Application Framework • Zend Framework • toolkit / glue style: use what you want or use it all • CakePHP & CodeIgnitor • lightweight MVC frameworks with data models • Symfony • MVC, more admin and configuration features http://framework.zend.com/ http://codeigniter.com/ http://cakephp.org/ http://www.symfony-project.org/ http://en.wikipedia.org/wiki/Web_application_framework Wednesday, May 13, 2009 37
  • 38. PHP Ecosystem Unit Testing Frameworks • PHPUnit • Most popular, derived from NUnit pattern • Simpletest • phpt http://www.simpletest.org/ http://phpt.info/ http://en.wikipedia.org/wiki/Unit_testing http://www.phpunit.de/ Wednesday, May 13, 2009 38
  • 39. PHP Ecosystem IDEs & Editors • Editors • pattern matched syntax highlighting & code folding • typically multi-language • especially good at text & code manipulation • IDEs • Language introspection (code completion) • Errors / Warnings / Syntax Check • Debugging capabilities (breakpoints, watches, profiling) http://en.wikipedia.org/wiki/Comparison_of_text_editors http://en.wikipedia.org/wiki/Integrated_development_environment http://www.xdebug.org/ Wednesday, May 13, 2009 39
  • 40. PHP Ecosystem IDEs & Editors • Eclipse-based IDEs • Zend Studio (paid) / PDT (open source) • great PHP editing and debugging • Aptana • javascript & css editing & code completion is excellent • debugging with xdebug • Text Editors • Ultraedit on Windows • Textmate on Mac • “E” is Textmate on Windows http://www.zend.com/en/products/studio/ http://www.eclipse.org/pdt/ http://www.ultraedit.com/ http://www.aptana.com http://www.macromates.com Wednesday, May 13, 2009 40