Chapter 8. Design how-to: date and time handling

8.1 Why object-oriented date and time handling? 153
8.2 Finding the right abstractions 155
8.3 Advanced object construction 158
8.4 Large-scale structure 163
8.5 Using value objects 173
8.6 Implementing the basic classes 176
8.7 Summary 186

Applying object-oriented principles and patterns tends to be more art than science, more improvisation than ritual, more understanding than precise skill. At worst, it’s like movie weddings. Real weddings are notoriously predictable and strictly organized. But in movie weddings, shock and awe is the rule: someone makes a blunder like saying “your awful wedded wife,” the bride or the groom runs away, the wedding guests start fighting, or worse.

We want to avoid ...

Get PHP in Action now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.