Приглашаем посетить
Достоевский (dostoevskiy-lit.ru)

This Book's Structure and Organization

Previous
Table of Contents
Next

This Book's Structure and Organization

This book is organized into five parts that more or less stand independently from one another. Although the book was designed so that an interested reader can easily skip ahead to a particular chapter, it is recommended that the book be read front to back because many examples are built incrementally throughout the book.

This book is structured in a natural progressionfirst discussing how to write good PHP, and then specific techniques, and then performance tuning, and finally language extension. This format is based on my belief that the most important responsibility of a professional programmer is to write maintainable code and that it is easier to make well-written code run fast than to improve poorly written code that runs fast already.

Part I, "Implementation and Development Methodologies"

Chapter 1, "Coding Styles"

Chapter 1 introduces the conventions used in the book by developing a coding style around them. The importance of writing consistent, well-documented code is discussed.

Chapter 2, "Object-Oriented Programming Through Design Patterns"

Chapter 2 details PHP 5's object-oriented programming (OOP) features. The capabilities are showcased in the context of exploring a number of common design patterns. With a complete overview of both the new OOP features in PHP 5 and the ideas behind the OOP paradigm, this chapter is aimed at both OOP neophytes and experienced programmers.

Chapter 3, "Error Handling"

Encountering errors is a fact of life. Chapter 3 covers both procedural and OOP error-handling methods in PHP, focusing especially on PHP 5's new exception-based error-handling capabilities.

Chapter 4, "Implementing with PHP: Templates and the Web"

Chapter 4 looks at template systemstoolsets that make bifurcating display and application easy. The benefits and drawbacks of complete template systems (Smarty is used as the example) and ad hoc template systems are compared.

Chapter 5, "Implementing with PHP: Standalone Scripts"

Very few Web applications these days have no back-end component. The ability to reuse existing PHP code to write batch jobs, shell scripts, and non-Web-processing routines is critical to making the language useful in an enterprise environment. Chapter 5 discusses the basics of writing standalone scripts and daemons in PHP.

Chapter 6, "Unit Testing"

Unit testing is a way of validating that your code does what you intend it to do. Chapter 6 looks at unit testing strategies and shows how to implement flexible unit testing suites with PHPUnit.

Chapter 7, "Managing the Development Environment"

Managing code is not the most exciting task for most developers, but it is nonetheless critical. Chapter 7 looks at managing code in large projects and contains a comprehensive introduction to using Concurrent Versioning System (CVS) to manage PHP projects.

Chapter 8, "Designing a Good API"

Chapter 8 provides guidelines on creating a code base that is manageable, flexible, and easy to merge with other projects.

Part II, "Caching"

Chapter 9, "External Performance Tunings"

Using caching strategies is easily the most effective way to increase the performance and scalability of an application. Chapter 9 probes caching strategies external to PHP and covers compiler and proxy caches.

Chapter 10, "Data Component Caching"

Chapter 10 discusses ways that you can incorporate caching strategies into PHP code itself. How and when to integrate caching into an application is discussed, and a fully functional caching system is developed, with multiple storage back ends.

Chapter 11, "Computational Reuse"

Chapter 11 covers making individual algorithms and processes more efficient by having them cache intermediate data. In this chapter, the general theory behind computational reuse is developed and is applied to practical examples.

Part III, "Distributed Applications"

Chapter 12, "Interacting with Databases"

Databases are a central component of almost every dynamic Web site. Chapter 12 focuses on effective strategies for bridging PHP and database systems.

Chapter 13, "User Authentication and Session Security"

Chapter 13 examines methods for managing user authentication and securing client/server communications. This chapter's focuses include storing encrypted session information in cookies and the full implementation of a single signon system.

Chapter 14, "Session Handling"

Chapter 14 continues the discussion of user sessions by discussing the PHP session extension and writing custom session handlers.

Chapter 15, "Building a Distributed Environment"

Chapter 15 discusses how to build scalable applications that grow beyond a single machine. This chapter examines the details of building and managing a cluster of machines to efficiently and effectively manage caching and database systems.

Chapter 16, "RPC: Interacting with Remote Services"

Web services is a buzzword for services that allow for easy machine-to-machine communication over the Web. This chapter looks at the two most common Web services protocols: XML-RPC and SOAP.

Part IV, "Performance"

Chapter 17, "Application Benchmarks: Testing an Entire Application"

Application benchmarking is necessary to ensure that an application can stand up to the traffic it was designed to process and to identify components that are potential bottlenecks. Chapter 17 looks at various application benchmarking suites that allow you to measure the performance and stability of an application.

Chapter 18, "Profiling"

After you have used benchmarking techniques to identify large-scale potential bottlenecks in an application, you can use profiling tools to isolate specific problem areas in the code. Chapter 18 discusses the hows and whys of profiling and provides an in-depth tutorial for using the Advanced PHP Debugger (APD) profiler to inspect code.

Chapter 19, "Synthetic Benchmarks: Evaluating Code Blocks and Functions"

It's impossible to compare two pieces of code if you can't quantitatively measure their differences. Chapter 19 looks at benchmarking methodologies and walks through implementing and evaluating custom benchmarking suites.

Part V, "Extensibility"

Chapter 20, "PHP and Zend Engine Internals"

Knowing how PHP works "under the hood" helps you make intelligent design choices that target PHP's strengths and avoid its weaknesses. Chapter 20 takes a technical look at how PHP works internally, how applications such as Web servers communicate with PHP, how scripts are parsed into intermediate code, and how script execution occurs in the Zend Engine.

Chapter 21, "Extending PHP: Part I"

Chapter 21 is a comprehensive introduction to writing PHP extensions in C. It covers porting existing PHP code to C and writing extensions to provide PHP access to third-party C libraries.

Chapter 22, "Extending PHP: Part II"

Chapter 22 continues the discussion from Chapter 21, looking at advanced topics such as creating classes in extension code and using streams and session facilities.

Chapter 23, "Writing SAPIs and Extending the Zend Engine"

Chapter 23 looks at embedding PHP in applications and extending the Zend Engine to alter the base behavior of the language.


Previous
Table of Contents
Next