PHP Team Development Easy and effective team work using MVC, agile development, source control, testing, bug tracking, and more Samisa Abeysinghe BIRMINGHAM - MUMBAI This material is copyright and is licensed for the sole use by David Martone on 16th September 2009 710 South Avenue West, , Westfield, , 07090 PHP Team Development Copyright © 2009 Packt Publishing All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book. Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information. First published: September 2009 Production Reference: 1240809 Published by Packt Publishing Ltd. 32 Lincoln Road Olton Birmingham, B27 6PA, UK. ISBN 978-1-847195-06-7 www.packtpub.com Cover Image by Ed Maclean (edmaclean@gmail.com) This material is copyright and is licensed for the sole use by David Martone on 16th September 2009 710 South Avenue West, , Westfield, , 07090 Download at WoWeBook.Com Credits Author Samisa Abeysinghe Reviewers Deepak Vohra Garvin Hicking Acquisition Editor Sarah Cullington Development Editor Dilip Venkatesh Technical Editors Mehul Shetty Akash Johari Copy Editor Leonard D'Silva Indexer Monica Ajmera Editorial Team Leader Akshara Aware Project Team Leader Lata Basantani Project Coordinator Rajashree Hamine Proofreader Joel T. Johnson Production Coordinator Adline Swetha Jesuthas Cover Work Adline Swetha Jesuthas Drawing Coordinator Nilesh R. Mohite This material is copyright and is licensed for the sole use by David Martone on 16th September 2009 710 South Avenue West, , Westfield, , 07090 Download at WoWeBook.Com About the Author Samisa Abeysinghe has nearly ten years of industrial experience with various software projects. He has been an Apache committer for many years and has worked for software product companies as well as software services companies. Samisa was the project leader for WSO2 Web services Framework for PHP projects for a couple of years and has an in-depth understanding on the enterprise use of PHP. He has been involved in helping many project teams use WSO2 WSF/PHP for enterprise projects. As director of engineering at WSO2, Samisa now looks after multiple teams working on various projects on a daily basis and gets involved with dening and ne-tuning processes and practices to ensure a project's success. Samisa is also the author of the book RESTful PHP Web Services. I would like to thank all the people who have worked with me on software projects from the day I started working in the software industry. All those people have greatly helped me in understanding this complex domain. I would like to mention the WSO2 team, including Sanjiva Weerewarana-CEO, and Paul Fremantle-CTO, all the members of the engineering leadership, as well as all the engineers. While it has been a pleasure to work with such a skilled team, it has also helped me to understand the software engineering realities better in practice. I would also like to mention the great helping hands rendered by the technical reviewers of this book as well as the project coordinator of this book. This material is copyright and is licensed for the sole use by David Martone on 16th September 2009 710 South Avenue West, , Westfield, , 07090 Download at WoWeBook.Com About the Reviewers Deepak Vohra is a consultant and a principal member of the NuBean.com software company. He is a Sun Certied Java Programmer and Web Component Developer, and has worked in the elds of XML, Java programming and J2EE for over ve years. He is the co-author of the Apress book Pro XML Development with Java Technology and was the technical reviewer for the O'Reilly book WebLogic: The Denitive Guide. He was also the technical reviewer for the Course Technology PTR book Ruby Programming for the Absolute Beginner, and the technical editor for the Manning Publications book Prototype and Scriptaculous in Action. Deepak is also the author of the Packt Publishing books JDBC 4.0 and Oracle JDeveloper for J2EE Development, and Processing XML Documents with Oracle JDeveloper 11g. Garvin Hicking is a passionate web-developer, who is engaged in open source projects like Serendipity (Lead Developer) and phpMyAdmin. He works at the Internet agency Faktor E GmbH in Bonn (Germany). Being up-to-date, he has been involved in writing or reviewing several books about PHP, the most recent one being the ofcial documentation of the PHP-Blog application Serendipity. Aside from his professional work, he and his girlfriend enjoy taking professional photographs. This material is copyright and is licensed for the sole use by David Martone on 16th September 2009 710 South Avenue West, , Westfield, , 07090 Download at WoWeBook.Com This material is copyright and is licensed for the sole use by David Martone on 16th September 2009 710 South Avenue West, , Westfield, , 07090 Download at WoWeBook.Com Table of Contents Preface 1 Chapter 1: Software is Complex 7 Need for teams 9 Software engineering principles to help 10 Use a process 12 Divide and conquer 13 Guarantee reuse 14 Guarantee integration 15 Prevent regression 15 Vertical versus horizontal division 15 Continuous integration 18 Patterns as solutions 19 Process for success 20 Tools 21 Source code control 21 Continuous builds 23 Issue tracking 24 Communication 25 Summary 27 Chapter 2: MVC and Software Teams 29 Software design patterns 29 MVC pattern 31 Intent 31 Motivation 31 Solution 32 Model 32 View 32 Controller 32 How MVC can help 33 This material is copyright and is licensed for the sole use by David Martone on 16th September 2009 710 South Avenue West, , Westfield, , 07090 Download at WoWeBook.Com Table of Contents [ ii ] MVC helps with change 34 Implementing MVC with a team 37 Aspects of the presentation layer (view) 38 The overall team distribution 42 Integration challenges 42 Summary 43 Chapter 3: Dealing with Complexity 45 Frameworks to simplify complexity 46 How can frameworks help? 46 Expectations from frameworks 49 Simplicity 50 Size of the framework 50 Performance 51 Security 51 Separate HTML from PHP 52 AJAX support 52 No restrictions 52 Object-oriented versus functional 53 Code quality of the project 53 Enforce best practices 54 Conguration needs 55 Internationalization 56 Documentation 56 Community 57 Commercial support 58 License 60 Vendor locking 61 Availability with hosting 61 Some more points to ponder 62 Team success with frameworks 62 Technical feasibility study of the framework 64 PHP Frameworks 65 Limb 65 phpDrone 65 ZNF 66 ATK 66 Akelos 66 CakePHP 67 CodeIgniter 67 Zend Framework 67 PHP Work 68 Symfony 68 KISS—beyond frameworks 68 Beyond frameworks 69 People are complex 69 Avoid NIH 70 This material is copyright and is licensed for the sole use by David Martone on 16th September 2009 710 South Avenue West, , Westfield, , 07090 Download at WoWeBook.Com Table of Contents [ iii ] Innovation 70 Embrace change 70 Simplicity is a mindset 71 Summary 72 Chapter 4: The Process Matters 73 Process and product 74 Ignoring the process 77 Process must be respected 78 From no process to some process 81 Process helps not hinder 83 Simple process for PHP projects 84 User requirements 85 Modeling what the users want 86 Data modeling 86 Business modeling 87 User activity analysis 88 Designs and implementing the data layer 88 Designs and implementing the business layer 89 Design and implementation of the user interface 90 Summary 93 Chapter 5: Agile Works Best 95 Introducing agile philosophy 96 Agile values 96 Agile principles 96 Individuals and interactions 97 Working software over comprehensive documentation 98 Customer collaboration 99 Responding to change 99 Customizing agile to our needs 100 Common fears for developers 100 Producing the wrong product 100 Product of inferior quality 100 Getting late to complete the project 101 Too much work in too little time 101 Traits of agile team members 102 Competence 102 Common focus 102 Collaboration 102 Decision-making ability 102 Fuzzy-problem solving ability 103 This material is copyright and is licensed for the sole use by David Martone on 16th September 2009 710 South Avenue West, , Westfield, , 07090 Download at WoWeBook.Com Table of Contents [ iv ] Mutual trust and respect 103 What is agility 103 Characteristics of an agile process 105 Principles of agility 105 Extreme Programming (XP) 107 XP planning 107 XP design 108 XP coding 108 XP testing 109 Advantages of agile development process 109 Team agility 110 Agile process models 111 Adaptive Software Development 111 Dynamic Systems Development Method 112 Dynamic Systems Development Method's life cycle 112 Scrum 112 Backlog 113 Sprints 113 Scrum meetings 114 Demos 114 Feature Driven Development 114 Agile Modeling 115 Agile for the PHP team 115 Pair programming 115 Sustainable working style 116 Information-driven workspace 117 Fixing the process 117 Sitting together 118 Ubiquitous language 118 Stand-up meetings 119 Demonstrate the iteration outcome 120 Summary 120 Chapter 6: Ways of Collaboration 123 Team work is challenging 124 Team members make assumptions 125 Making integration possible 126 Source control 127 Bug control 130 Conguration management 136 Tools for communication and collaboration 140 Tracking tools 144 Summary 146 This material is copyright and is licensed for the sole use by David Martone on 16th September 2009 710 South Avenue West, , Westfield, , 07090 Download at WoWeBook.Com [...]... people However, today, we need teams of people for PHP projects This chapter explores the need for teams for PHP projects It also discusses how software engineering principles help with PHP projects There is an increasing need to use a process for PHP projects The complexity of having a team is figuring out how to divide the project's problem among team members and solve it This chapter discusses how... the PHP project to cope with complexity Finally, we will explore how to use tools to manage the development and collaboration within the PHP team Chapter 2, MVC and Software Teams, discusses the MVC pattern in depth and how MVC can help in a PHP project It also explores how to use the MVC pattern as the guiding principle to break down the complexity of a project, and how to implement MVC with a team. .. using a PHP framework, there are a bunch of expectations; we will explore what to expect and what to look for in a PHP framework The mere use of a PHP framework would not guarantee project success Hence, we will discuss how to achieve team success with PHP frameworks in this chapter We will also look at some leading PHP frameworks Moreover, we will also learn how to make things simple while using a PHP. .. one PHP developer—and that is a team If you look into a more complex enterprise scenario, such as online trading or social networking, your team could consist of around 10 to 100 people, or even more Many PHP- based dynamic web sites could be managed effectively with about two good PHP developers However, the number of members that you need in a team is very much dependant on the nature of the PHP project... seamlessly Having said that, the PHP project team that works on the PHP project for an organization—can also benefit from the luxury of the PHP language, being powerful and flexible Therefore, you do not need a rigorous process either So where is the fine balance? Many software professionals now turn to agile processes PHP teams can greatly benefit from an agile process, because PHP can help you live with... applications that are completely written in PHP We are also seeing that blogging web applications are replacing private web sites at a very fast rate, and the blogging platforms are completely implemented in PHP In this chapter, you will learn: • The need for teams for PHP projects • How software engineering principles help with PHP projects • The need for a process for PHP projects • Dividing the project... help with PHP projects • The need for a process for PHP projects • Dividing the project problem and conquering it • How patterns help with PHP projects • Using tools to manage the development and collaboration within the PHP team Need for teams We need the help of a team of people to successfully implement a solution to a complex problem When we are trying to implement a solution for some problem, one...Table of Contents Chapter 7: Continuous Improvement 147 Index 163 Dealing with change in PHP applications Ensuring process effectiveness Ensure you are improving Evolving PHP applications People development Teams and success Managing the team Leadership Quality focus Constant monitoring The team is human Summary 148 150 153 153 156 157 158 159 160 160 160 161 [v] Download at WoWeBook.Com... requests So it is obvious that you need a team, and you might already be part of a team Perhaps this is the reason why you are reading this book, or you might want to join on organization where there are teams Software engineering principles to help People have worked as teams on software projects for many years Can the same techniques be used for your team PHP project? Yes they can Then why read this... worked with a project team on a PHP application, it will make it easier to relate to your experiences However, if you are a beginner, and want to learn what it takes to work with a team and be successful, this book will provide a wealth of knowledge Who this book is for This book is for PHP developers who work in complex PHP projects Those who want to know the secrets of success for PHP projects that meet . PHP Team Development Easy and effective team work using MVC, agile development, source control, testing, bug. 62 Team success with frameworks 62 Technical feasibility study of the framework 64 PHP Frameworks 65 Limb 65 phpDrone 65 ZNF 66 ATK 66 Akelos 66 CakePHP