Table of Contents
Foreword xi Introduction xiii
Acknowledgments xvii
About the Authors xix
Chapter 1: Models 1
AntiPattern: Voyeuristic Models 2
AntiPattern: Fat Models 14
AntiPattern: Spaghetti SQL 31
AntiPattern: Duplicate Code Duplication 50
Chapter 2: Domain Modeling 73
AntiPattern: Authorization Astronaut 74
AntiPattern: The Million-Model March 79
Chapter 3: Views 89
AntiPattern: PHPitis 91
AntiPattern: Markup Mayhem 107
Chapter 4: Controllers 117
AntiPattern: Homemade Keys 118
AntiPattern: Fat Controller 123
AntiPattern: Bloated Sessions 154
AntiPattern: Monolithic Controllers 161
AntiPattern: Controller of Many Faces 167
AntiPattern: A Lost Child Controller 170
AntiPattern: Rat’s Nest Resources 180
AntiPattern: Evil Twin Controllers 184
Chapter 5: Services 189
AntiPattern: Fire and Forget 190
AntiPattern: Sluggish Services 195
AntiPattern: Pitiful Page Parsing 197
AntiPattern: Successful Failure 201
AntiPattern: Kraken Code Base 207
Chapter 6: Using Third-Party Code 211
AntiPattern: Recutting the Gem 213
AntiPattern: Amateur Gemologist 214
AntiPattern: Vendor Junk Drawer 216
AntiPattern: Miscreant Modification 217
Chapter 7: Testing 221
AntiPattern: Fixture Blues 223
AntiPattern: Lost in Isolation 236
AntiPattern: Mock Suffocation 240
AntiPattern: Untested Rake 246
AntiPattern: Unprotected Jewels 251
Chapter 8: Scaling and Deploying 267
AntiPattern: Scaling Roadblocks 268
AntiPattern: Disappearing Assets 271
AntiPattern: Sluggish SQL 272
AntiPattern: Painful Performance 282
Chapter 9: Databases 291
AntiPattern: Messy Migrations 292
AntiPattern: Wet Validations 297
Chapter 10: Building for Failure 301
AntiPattern: Continual Catastrophe 302
AntiPattern: Inaudible Failures 306
Index 311