突然接到Packt publishing的邮件,内容是关于”Object-Orientated Programming with PHP5“的书评。
以前从来没有做过书评,对于评论的样式内容结构的不合理,在此对读者表示歉意。
内容
简要概述,这本书的章节是:
面向对象(OOP)与程序设计(PS:应该是面向过程吧)(什么是OOP?,为什么要OOP?, 两者的区别等等)
开始 OOP (对象(封装),继承,多态等等)
高级OOP (使用 PHP 函数,异常,迭代等等)
设计模式Design Patterns (Strategy, Singleton, Adapter, Observer, Decorator etc)(这里就不译了)
反射和单元测试(phpUnit)
Standard PHP Library (著名的SPL)
OOP数据库 (MySQLi, PDO, 数据持久层Abstraction layers - PEAR::MDB2, ADODB and Active Record)
OOP和XML (SimpleXML, xpath, Dom)
MVC / Frameworks
针对初/中水平开发人员
支持
适当的介绍了 SPL (Standard PHP Library)
介绍了 PDO, PEAR::MDB2, AdoDB and MySQLi
介绍了主要的面向对象设计模式
介绍了MVC和frameworks(框架)
反对
只有250页
不够深入
很多语法错误,希望在出版的时候能够改正这些错误。
有很多拼写错误 (e.g. s/Mehod()/Method())
有些例子很差(请见下文)
十页的篇幅去讲PHPUnit API,在最后讲使用框架开发一个项目,我觉得应该利用一部分篇幅将一个主要的框架,例如zend或者codeignitor。话虽如此,我觉得这本书还是不错的,尤其是能学到别人怎么解决问题,这对于初中级开发人员会有很大的帮助。
代码实例
为了使这本书更有意思,第四章讲了很多主要的设计模式。其中一个decorator模式,部分代码如下:
$post = new Post();
$comment = new Comment();
$post->filter();
$comment->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.
}

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

WebStorm Mac version
Useful JavaScript development tools

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Atom editor mac version download
The most popular open source editor
