~/talk

Beyond design patterns and principles - writing good OO code

Talkat Dutch PHP Conference 2019 · 2019-06-06..06-08· [php, software-architecture]
slides:none on file

Practical rules for better OO: favor wrap primitives into value objects (email, money, coordinates) to enforce validation and cohesion; require complete state in constructors and avoid setter parties; apply CQS: commands void, queries return values and validate state transitions with exceptions and postconditions; prefer composition over inheritance and inject behavior via constructor (e.g., exchange-rate service or dice provider) so tests control behavior; use static analysis like PHPStan/Psalm and stricter types to catch mixed return types and make failures loud rather than hidden.

AI-written summary · about

  1. 0:00Beyond Design Principles & Patterns
  2. 0:56Writing good OO code
  3. 1:11Design patterns
  4. 3:08Design principles, and more patterns
  5. 4:35Education
  6. 7:22Objects introduce meaning
  7. 10:10Objects keep together what belongs
  8. 11:04Cohesion
  9. 11:48Objects bring together meaningful behaviors
  10. 16:23For all objects
  11. 16:59At construction time
  12. 18:28At modification time
  13. 18:54What's the "right" data?
  14. 22:02Command/Query Separation
  15. 24:34CQS principle
  16. 25:04Return single-type values
  17. 27:03At failure time
  18. 27:19Offensive programming
  19. 31:53State versus behavior, revisited
  20. 33:29Treat your objects as black boxes
  21. 34:45Don't test constructors by calling getters
  22. 38:22Changing the behavior of an object
  23. 40:55Composition over inheritance
  24. 41:17Guiding experiment
  25. 42:19Create better objects
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 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
?
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.