Learning PHP Design Patterns
Publisher: O'Reilly Media
Final Release Date: February 2013
Pages: 362

Build server-side applications more efficiently—and improve your PHP programming skills in the process—by learning how to use design patterns in your code. This book shows you how to apply several object-oriented patterns through simple examples, and demonstrates many of them in full-fledged working applications.

Learn how these reusable patterns help you solve complex problems, organize object-oriented code, and revise a big project by only changing small parts. With Learning PHP Design Patterns, you’ll learn how to adopt a more sophisticated programming style and dramatically reduce development time.

  • Learn design pattern concepts, including how to select patterns to handle specific problems
  • Get an overview of object-oriented programming concepts such as composition, encapsulation, polymorphism, and inheritance
  • Apply creational design patterns to create pages dynamically, using a factory method instead of direct instantiation
  • Make changes to existing objects or structure without having to change the original code, using structural design patterns
  • Use behavioral patterns to help objects work together to perform tasks
  • Interact with MySQL, using behavioral patterns such as Proxy and Chain of Responsibility
  • Explore ways to use PHP’s built-in design pattern interfaces
Table of Contents
Product Details
About the Author
Colophon
Recommended for You
Customer Reviews

REVIEW SNAPSHOT®

by PowerReviews
oreillyLearning PHP Design Patterns
 
3.6

(based on 5 reviews)

Ratings Distribution

  • 5 Stars

     

    (1)

  • 4 Stars

     

    (3)

  • 3 Stars

     

    (0)

  • 2 Stars

     

    (0)

  • 1 Stars

     

    (1)

80%

of respondents would recommend this to a friend.

Pros

  • Easy to understand (4)
  • Helpful examples (4)
  • Accurate (3)
  • Well-written (3)

Cons

    Best Uses

    • Intermediate (4)
      • Reviewer Profile:
      • Developer (4)

    Reviewed by 5 customers

    Sort by

    Displaying reviews 1-5

    Back to top

     
    4.0

    Useful for grokking design patterns

    By MountainQuail

    from Seattle, WA

    Verified Buyer

    Pros

    • Easy to understand
    • Helpful examples

    Cons

      Best Uses

      • Intermediate
      • Novice

      Comments about oreilly Learning PHP Design Patterns:

      I have heard design patterns mentioned for years but had never engaged with them. PHP is my main language so I was happy to see a book about PHP Design Patterns. The author did a good job explaining what they are, why, when and how you use them, and providing specific examples. So I feel as if I'm further along in being able to use design patterns in my programming. I would say the book is for beginning and intermediate programmers.

      (2 of 2 customers found this review helpful)

       
      4.0

      An intuitive and pleasant book to read

      By Tom K

      from Melbourne, VIC

      About Me Developer, Php Enthusiast

      Verified Reviewer

      Pros

      • Accurate
      • Concise
      • Easy to understand
      • Helpful examples
      • Well-written

      Cons

        Best Uses

        • Intermediate
        • Student

        Comments about oreilly Learning PHP Design Patterns:

        I found this book to be quite well-written and all-around useful towards understanding design patterns, although I know Java, most of my experience is with PHP, so I can best understand and grasp the concepts with PHP, more so than Java at the current time, and this book really helped me in doing so.

        If I had any concerns, there would only be one, and that is that I believe it could have had perhaps an extra example per pattern, and that it would perhaps include an example on sessions / keeping users logged in, through-out an application, showing how a pattern could work, in doing so. (Hint: Perhaps a 2nd edition? I'd buy it).

        If you are comfortable with PHP and have 2+ years of experience with programming, I'd suggest this book as a great start towards design patterns.

        (3 of 3 customers found this review helpful)

         
        5.0

        A very well written OOD book

        By Batoru Yukio

        from Bucharest, Romania

        About Me Designer, Developer

        Verified Reviewer

        Pros

        • Accurate
        • Concise
        • Easy to understand
        • Helpful examples
        • Well-written

        Cons

          Best Uses

          • Intermediate

          Comments about oreilly Learning PHP Design Patterns:

          I found this book very well written and concise. The concepts are very well presented and easy to grasp. Priceless!

          (5 of 5 customers found this review helpful)

           
          4.0

          Web programmers will want to read this

          By Life is a Blur

          from Ottawa Canada

          About Me Developer, Sys Admin

          Verified Reviewer

          Pros

          • Accurate
          • Easy to understand
          • Helpful examples
          • Well-written

          Cons

            Best Uses

            • Intermediate
            • Novice

            Comments about oreilly Learning PHP Design Patterns:

            PHP's success as a web app language comes largely from its freedom from structure: you can hack code together and do almost anything. But what if your app is large, you don't want errors, and you want to understand it? Think of Vtiger, which combines (yikes) code from SugarCRM, Smarty, ckeditor, antlr, PearDatabase, adodb, freetag, nusoap, phpmailer, tcpdf, PDFMaker, htmlpurifier, php_writeexcel, kcfinder, log4php, AjaxUpload, HTMLSax3, iCal, qCal, PHPMailer, and Image_Graph projects, not to mention several Javascript libraries. The many subprojects are structured using Object Oriented (OO) concepts, which gives you a hope of understanding it.

            To succeed in larger projects you need some structure, and PHP Design Patterns proposes that you use the same high level structures that have been useful to C++ and Java programmers for many years. The author read the 'Gang of 4′ book (Gamma, Helm, Johnson and Vlissides), and has interpreted it in the PHP context. He starts with a refresher on Object Oriented programming, which will be easy reading for anyone with knowledge of OO. Then he shows how to make best use of the OO features in PHP since version 5, referencing the most useful design patterns. Inheritance, polymorphism, encapsulation are all discussed with example code in php.

            Returning to the Vtiger example, when the code uses some OO structure, it is often not clear what pattern is in use. A file should start with comments on what design pattern is being used, and if not, then a discussion of how the objects are used. If the designers had started with the common design patterns from this book, then it would all be more clear.

            I want you to read this well written book in the hopes that the next php projects I need to enhance will be well structured and easier to work with. This means you! Why would you not just Google The Fine Thing (GTFT)? Because then you get snowed with poorly edited info. Read the book for a well organized presentation of the few important, common patterns.

            Disclaimer: I read the electronic version of the book, on a smartphone. The reading experience is quite different from bound, paper books with pros and cons. Disclaimer 2: I got the book through the O'Reilly blogger program.

            If this book interests you, then you might also want to read Javascript patterns By Stoyan Stefanov for a complementary treatment of the client side language.

            (7 of 21 customers found this review helpful)

             
            1.0

            Very confusing

            By teak

            from Jyväskylä, Finland

            About Me Designer, Developer

            Verified Reviewer

            Pros

              Cons

              • Difficult to understand

              Best Uses

                Comments about oreilly Learning PHP Design Patterns:

                The main question which this book provoked me to think is following:
                Is this book really badly written or am I an idiot?

                In physics word "Introduction" in the title of a book is a code word for highly advanced text. Does the word "Learning" have same meaning in the computer science? The preface of this book doesn't support this assumption, nor does Learning Perl book also from O'Reilly. In matter of the fact the book starts with a refresher/introduction to object oriented programming. So the text shouldn't be highly advanced.

                When the book moved from the intro part into the design patterns part I got totally lost. I had to google almost every presented pattern in order to understand what they do and why they are used. It was very frustrating as the title of the book gives impression that the book is geared towards novices. I think that one of the causes for this was the extensive verbosity, which just made the book confusing.

                At one point of the book I started to suspect that the author had a quota of pages to fill. As I mentioned the book was verbose to the level of obscurity. The book had also a lot of filler material, like each chapter started with half page worth of irrelevant quotes, it had full css-files for examples, and a lot of duplicate code.

                I have to say that I couldn't find any redemptive features from the book. I had to force myself to read it while not getting anything from it.

                I wont recommend the book for anyone.

                disclaimer: I received the book through O'Reilly blogger review program.

                Displaying reviews 1-5

                Back to top

                 
                Buy 2 Get 1 Free Free Shipping Guarantee
                Buying Options
                Immediate Access - Go Digital what's this?
                Ebook: $33.99
                Formats:  DAISY, ePub, Mobi, PDF
                Print & Ebook: $43.99
                Print: $39.99

                Available in Multiple Languages