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.
Raramente capita di mettere il minimo dei voti a un libro O'Reilly...
Le spiegazioni sono quasi incomprensibili, le frasi inutilmente convolute, spesso messe in forma passiva o negativa (o addirittura con doppie negazioni), al punto da rendere stressante la lettura.
Gli esempi sono assurdi. Uno su tutti: usare un observer per propagare le modifiche a tre versioni del layout, quando si sarebbe potuto usare lo stesso esempio per uno strategy. Forse hanno senso in un altro linguaggio, ma non in PHP, e visto che si chiama "Learning PHP Design Patterns" e non "Learning Design Patterns", sono totalmente sbagliati. Altri sono talmente complicati che non si capisce nemmeno come funzionino. E la spiegazione è messa al contrario: a parte una inutile descrizione troppo astratta, prima mette il codice, e poi FORSE spiega perché fa certe cose. Non sempre. A volte nemmeno lo spiega.
This book is only an "OK" introduction to these topics. Luckily I have a skilled colleague who was able to to further explain/clarify many of the concepts. The biggest problem with the book is that often the examples are very poor and don't really drive home the salient points. There are also a few example where the author presents too much detail of a possible implementation, including HTML & CSS for a form, which I found completely unnecessary for understanding how a pattern might be used for a problem. The book did at least spark my interest in learning and understanding more about using patterns properly.
The book is probably OK, but during the fifth chapter I began questioning the use of object-oriented paradigm itself. I probably should disclose that I love Scala and JavaScript which both use a bit different paradigms, object-functional and Object-linked-to-other-objects with functional capabilities.