PHP Objects, Patterns and Practice (3rd edition)

(Barry) #1

■ INDEX


factory, definition of, 44, 148


Factory Method pattern
ApptEncoder class, 153
being wary of duplicate conditionals, 154
BloggsCal format, 153
CommsManager class, 153
getApptEncoder(), 153, 156
getHeaderText(), code listing, 154
implementing, 155
instantiating a BloggsApptEncoder object,
code listing, 153
letting specialist classes handle object
instantiation, 152
MegaCal classes, class diagram, 156
MegaCal format, 153
overview of, 152, 155
redesignating CommsManager as an
abstract class, 155
return types, documenting, 156
summary of, 157
fail(), 385
failure element, 447
fatal errors, 56
favoring composition over inheritance, 132, 169
Fedora 12, 432
FeedbackCommand class, 219


fetch(), 298
Field class, code listing, 304
file attribute, 422
file element, 336
file(), 91
FileException class, 55
FileSet data type, 417
fileset element
defining, 417
table of attributes, 417
filterchain element, 419–420
filters, 419
final keyword, 57
find(), 278–280, 291
findAll(), 286
findBySpaceId(), 296
findByVenue(), 286
finder(), 294
fixture, definition of, 383


fluent interface, 304, 389–390
fopen(), 79


Forest class, 180
forward(), 259
Foswiki, 460
Fowler, Martin, 5, 110, 124–125, 143, 224, 456
Front Controller pattern
advantages and disadvantages of, 244
ApplicationHelper class, code listing, 237
centralizing a system’s presentation logic,
245
checking input from the user, 241
Command class, 241
CommandResolver class, code listing, 240
Controller class, code listing, 236
creating command classes, 241
DefaultCommand class, code listing, 243
doExecute(), 243
ensure(), 239
execute(), 243
FrontController class, code listing, 246
getCommand(), 240
getOptions(), 239
handleRequest(), 237
implementing, 236
init(), 237
life cycle of a request, illustration of, 244
main.php, code listing, 243
managing the progression from view to
view, 236
overview of, 235
Request class, code listing, 242
run(), 237
throwing exceptions, 239
Fuecks, Harry, 5
function keyword, 19
functional tests, 379

■ G
Gamma, Erich, 5, 125
Gang of Four, 4, 109, 124–126
__get(), 58
get_class(), 83
get_class_methods(), 84
get_class_vars(), 85
get_declared_classes(), 82
get_include_path(), 79
get_parent_class(), 85
getAllParams(), 102
Free download pdf