~/talk

Beyond design patterns and principles - writing good OO code

Talkat Forum PHP 2018 · 2018-10-25..10-26· [software-architecture]
slides:none on file

Argues that good OO means wrapping primitives into types, enforcing complete, coherent state at construction, and preferring composition over inheritance so behavior changes by injection not subclassing. Recommends constructor injection only, no optional setters, fail early with exceptions, and strict return types (empty lists not null). Separates mutations from queries with command vs query. Use static analysis and tools like PHPStan at max level and "safe" wrappers to spot functions that return false so failures become loud and debuggable.

AI-written summary · about

  1. 0:00Introduction to talk
  2. 0:24Beyond design patterns
  3. 1:09Problems with design patterns
  4. 3:18Back to basics of OOP
  5. 4:21Primitive types and objects
  6. 6:07Good class design principles
  7. 8:15Wrapping primitive values
  8. 10:03Combining values into objects
  9. 11:29Objects attracting behavior
  10. 12:32State versus behavior in objects
  11. 13:57Types of objects diagram
  12. 15:03Consistent object states
  13. 16:50Constructor and setter injection
  14. 18:14Validating input and state
  15. 19:39Fail early in methods
  16. 21:25Command query separation
  17. 23:59Return types and exceptions
  18. 25:44Offensive programming approach
  19. 26:51Static analysis tools
  20. 28:35Hiding implementation details
  21. 29:57Testing objects as black boxes
  22. 32:29Composition over inheritance
  23. 35:15Summary of best practices
  24. 36:44Q&A session
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.