Suddenly received Packt publishing mail, the content is about "object-orientated programming with PHP5" book review.
I have never done reviews before, and I apologize to the readers for the unreasonable structure of the content of the comments.
Content
A brief overview of the book's Chapters is:
Object-oriented (OOP) and programming (PS: should be process-oriented bar) (what is OOP?) , why OOP? , the difference between the two, etc.)
Start OOP (Objects (encapsulation), inheritance, polymorphism, etc.)
Advanced OOP (using PHP functions, exceptions, iterations, etc.)
Design Patterns Patterns (strategy, Singleton, Adapter, Observer, decorator etc) (not translated here)
Reflection and Unit Test (PHPUNIT)
Standard PHP Library (known as SPL)
OOP database (mysqli, PDO, data persistence layer abstraction LAYERS-PEAR::MDB2, ADODB and Active record)
OOP and XML (SimpleXML, XPath, Dom)
Mvc/frameworks
For primary/middle level developers
Support
The appropriate introduction of SPL (Standard PHP Library)
Introduced PDO, PEAR::MDB2, AdoDB and Mysqli
The main object-oriented design pattern is introduced.
Describes MVC and frameworks (framework)
against
only 250 pages
not deep enough
many grammatical errors, hoping to correct them when publishing.
There are a lot of spelling mistakes (e.g. S/mehod ()/method ())
Some examples are bad (see below)
10 pages to talk about the PHPUnit API, and in the end, using the framework to develop a project, I feel that a part of the space should be used to make a major framework, such as Zend or Codeignitor. Having said that, I think the book is good, especially to learn how to solve the problem, which will be very helpful to the middle-level developers.
code instance
to make this book more interesting, the fourth chapter introduces a number of major design patterns. One of the decorator patterns is as follows:
$post = new post (),
$comment = new comment ();
$post->filter ();
$com Ment->filter ();
if ($BBCodeEnabled ==false && $EmoticonEnabled ==false) {
$PostContent = $post-> GetContent ();
$CommentContent = $comment->getcontent ();
}
ElseIf ($BBCodeEnabled ==true && $EmoticonEnabled ==false) {
$bb = new Bbcodeparser ($post);
$PostContent = $bb->getcontent ();
$bb = new Bbcodeparser ($comment);
$CommentContent = $bb->getcontent ();
}
ElseIf ($BBCodeEnabled ==false && $EmoticonEnabled ==true) {
$em = new Emoticonparser ($post);
//etc.
}