The Singleton Chapter
I was reviewing the editing of the Singleton chapter last night. It was kind of interesting to look it over again, as I originally wrote, and had the tech review performed, on this chapter back in December of 2004! Looking it over again I am pretty proud of the decisions I made in writing it. One important decision was to not make the Singleton pattern the first design pattern explained in the book. The actual sequence of chapters up to this point is:
- Preface
- Programming Practices
- The ValueObject Pattern
- The Factory Pattern
- The Singleton Pattern
So the Singleton pattern is the third pattern covered in the book. The Programming Practices chapter gave me a chance to introduce Unit Testing and Refactoring, which is very important considering the heavy use of SimpleTest throughout the rest of the book for unit tests of the code. As I mentioned in an earlier blog entry, the unit tests are not just included in the code download, but integrated directly into the prose and flow of each chapter. The ValueObject pattern discussion gave me a chance to review references in PHP4 and object handles in PHP5 in much greater detail, and doing FactoryMethod next lets me allude to the fact that the Singleton is essentially a specialized Factory which only returns a single instance of a class.
In the book I try to give equal coverage to PHP4 and PHP5, but this particular chapter I spend much more time with PHP4 examples, as having private constructors in PHP5 make implementing the pattern relatively easy. I cover several possible implementations, and highlight the fact that the Zend 1 engine does not store references in static variables (as noted in the manual).
I briefly cover the MonoState pattern here as well, since they end up exhibiting similar behaviors, and you can do some neat code with reference —non-object related references!—to implement the MonoState pattern.
All OK, but what about the point pattern? I think the simplest way of exploring point pattern data, using PHP, is by examining a two-dimensional frequency distribution of counts within equal-area units imposed on the study area, giving an impression of how the intensity of the point process varies; this can be extended to kernel estimation. Nearest neighbour distances are also used to analyse intensity. Intensity in this sense is a first order property, the mean number of events per unit area at point tex2html_wrap_inline787 . Spatial dependence is captured by the second order properties of a spatial point process, which involve the relationship between numbers of events in pairs of arbitrary areas within the chosen study area: tex2html_wrap_inline795 . For a stationary process, this relationship depends on the distance and direction between the pair of areas; when the relationship depends on distance alone, the process is termed isotropic.
Agreed, but having an empirical data set is not sufficient to test for divergences from randomness. In general, tests are conducted against a standard model for complete spatial randomness following a homogeneous Poisson process over the study area. This implies that any of the events could have occurred anywhere in the study area, and that the locations of the events are mutually independent. This is enough for a start, but quickly encounters difficulties, when the underlying control distribution is not homogeneous across the study area. What do you think Jason?
There are of course many technologies to perform pattern recognition, most derived from non-linear adaptive technologies like Artifical Neural Networks. I think perhaps Bayseian Networks are better suited to the kinds of patterns you would see related to web development and related problems. And both of you know this is not the kind of pattern I am talking about in the book 😉
Jason how about giving us a little preview by posting the entire table of contents?