• Complain

Zandstra - PHP objects, patterns, and practice: build powerful code by mastering PHPs object-oriented enhancements, design patterns, and essential development tools

Here you can read online Zandstra - PHP objects, patterns, and practice: build powerful code by mastering PHPs object-oriented enhancements, design patterns, and essential development tools full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. City: Berkeley;CA, year: 2016, publisher: Apress, genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

Zandstra PHP objects, patterns, and practice: build powerful code by mastering PHPs object-oriented enhancements, design patterns, and essential development tools
  • Book:
    PHP objects, patterns, and practice: build powerful code by mastering PHPs object-oriented enhancements, design patterns, and essential development tools
  • Author:
  • Publisher:
    Apress
  • Genre:
  • Year:
    2016
  • City:
    Berkeley;CA
  • Rating:
    4 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 80
    • 1
    • 2
    • 3
    • 4
    • 5

PHP objects, patterns, and practice: build powerful code by mastering PHPs object-oriented enhancements, design patterns, and essential development tools: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "PHP objects, patterns, and practice: build powerful code by mastering PHPs object-oriented enhancements, design patterns, and essential development tools" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

Zandstra: author's other books


Who wrote PHP objects, patterns, and practice: build powerful code by mastering PHPs object-oriented enhancements, design patterns, and essential development tools? Find out the surname, the name of the author of the book and a list of all author's works by series.

PHP objects, patterns, and practice: build powerful code by mastering PHPs object-oriented enhancements, design patterns, and essential development tools — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "PHP objects, patterns, and practice: build powerful code by mastering PHPs object-oriented enhancements, design patterns, and essential development tools" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
Part I
Objects
Matt Zandstra 2016
MATT ZANDSTRA PHP Objects, Patterns, and Practice 10.1007/978-1-4842-1996-6_1
1. PHP: Design and Management
Matt Zandstra 1
(1)
Liverpool, Merseyside, UK
Electronic supplementary material
The online version of this chapter (doi: 10.1007/978-1-4842-1996-6_1 ) contains supplementary material, which is available to authorized users.
In July 2004 PHP 5.0 was released. This version introduced a suite of radical enhancements. Perhaps first among these was radically improved support for object-oriented programming. This stimulated much interest in objects and design within the PHP community. In fact, this was an intensification of a process that began when version 4 first made object-oriented programming with PHP a serious reality.
In this chapter, I look at some of the needs that coding with objects can address. I very briefly summarize some aspects of the evolution of patterns and related practices.
I also outline the topics covered by this book.
I will look at the following:
  • The evolution of disaster : A project goes bad.
  • Design and PHP : How object-oriented design techniques took root in the PHP community.
  • This book : Objects. Patterns. Practice.
The Problem
The problem is that PHP is just too easy. It tempts you to try out your ideas, and flatters you with good results. You write much of your code straight into your web pages, because PHP is designed to support that. You add utility functions (such as database access code) to files that can be included from page to page, and before you know it you have a working web application.
You are well on the road to ruin. You dont realize this, of course, because your site looks fantastic. It performs well, your clients are happy, and your users are spending money.
Trouble strikes when you go back to the code to begin a new phase. Now you have a larger team, some more users, a bigger budget. Yet, without warning, things begin to go wrong. Its as if your project has been poisoned.
Your new programmer is struggling to understand code that is second nature to you, although perhaps a little byzantine in its twists and turns. She is taking longer than you expected to reach full strength as a team member.
A simple change, estimated at a day, takes three days when you discover that you must update 20 or more web pages as a result.
One of your coders saves his version of a file over major changes you made to the same code some time earlier. The loss is not discovered for three days, by which time you have amended your own local copy. It takes a day to sort out the mess, holding up a third developer who was also working on the file.
Because of the applications popularity, you need to shift the code to a new server. The project has to be installed by hand, and you discover that file paths, database names, and passwords are hard-coded into many source files. You halt work during the move because you dont want to overwrite the configuration changes the migration requires. The estimated two hours becomes eight as it is revealed that someone did something clever involving the Apache module ModRewrite , and the application now requires this to operate properly.
You finally launch phase 2. All is well for a day and a half. The first bug report comes in as you are about to leave the office. The client phones minutes later to complain. Her report is similar to the first, but a little more scrutiny reveals that it is a different bug causing similar behavior. You remember the simple change back at the start of the phase that necessitated extensive modifications throughout the rest of the project.
You realize that not all of the required modifications are in place. This is either because they were omitted to start with or because the files in question were overwritten in merge collisions. You hurriedly make the modifications needed to fix the bugs. Youre in too much of a hurry to test the changes, but they are a simple matter of copy-and-paste, so what can go wrong?
The next morning you arrive at the office to find that a shopping basket module has been down all night. The last-minute changes you made omitted a leading quotation mark, rendering the code unusable. Of course, while you were asleep, potential customers in other time zones were wide awake and ready to spend money at your store. You fix the problem, mollify the client, and gather the team for another days firefighting.
This everyday tale of coding folk may seem a little over the top, but I have seen all these things happen over and over again. Many PHP projects start their life small and evolve into monsters.
Because the presentation layer also contains application logic, duplication creeps in early as database queries, authentication checks, form processing, and more are copied from page to page. Every time a change is required to one of these blocks of code, it must be made everywhere that the code is found, or bugs will surely follow.
Lack of documentation makes the code hard to read, and lack of testing allows obscure bugs to go undiscovered until deployment. The changing nature of a clients business often means that code evolves away from its original purpose until it is performing tasks for which it is fundamentally unsuited. Because such code has often evolved as a seething, intermingled lump, it is hard, if not impossible, to switch out and rewrite parts of it to suit the new purpose.
Now, none of this is bad news if you are a freelance PHP consultant. Assessing and fixing a system like this can fund expensive espresso drinks and DVD box sets for six months or more. More seriously, though, problems of this sort can mean the difference between a businesss success or failure.
PHP and Other Languages
PHPs phenomenal popularity meant that its boundaries were tested early and hard. As you will see in the next chapter, PHP started life as a set of macros for managing personal home pages. With the advent of PHP 3 and, to a greater extent, PHP 4, the language rapidly became the successful power behind large enterprise websites. In many ways, however, the legacy of PHPs beginnings carried through into script design and project management. In some quarters, PHP retained an unfair reputation as a hobbyist language, best suited for presentation tasks.
About this time (around the turn of the millennium), new ideas were gaining currency in other coding communities. An interest in object-oriented design galvanized the Java community. Since Java is an object-oriented language, you may think that this is a redundancy. Java provides a grain that is easier to work with than against, of course, but using classes and objects does not in itself determine a particular design approach.
The concept of the design pattern as a way of describing a problem, together with the essence of its solution, was first discussed in the 1970s. Perhaps aptly, the idea originated in the field of architecture, not computer science. By the early 1990s, object-oriented programmers were using the same technique to name and describe problems of software design. The seminal book on design patterns, Design Patterns: Elements of Reusable Object-Oriented Software (Addison-Wesley Professional, 1995) by Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides (henceforth referred to in this book by their affectionate nickname, the Gang of Four ), is still indispensable today. The patterns it contains are a required first step for anyone starting out in this field, which is why most of the patterns in this book are drawn from it.
Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «PHP objects, patterns, and practice: build powerful code by mastering PHPs object-oriented enhancements, design patterns, and essential development tools»

Look at similar books to PHP objects, patterns, and practice: build powerful code by mastering PHPs object-oriented enhancements, design patterns, and essential development tools. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «PHP objects, patterns, and practice: build powerful code by mastering PHPs object-oriented enhancements, design patterns, and essential development tools»

Discussion, reviews of the book PHP objects, patterns, and practice: build powerful code by mastering PHPs object-oriented enhancements, design patterns, and essential development tools and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.