Talk in English - US at PHP TEK 2025
Track Name:
Roave Stadium
View Slides: https://stevegrunwell.com/slides/value-objects
Short URL: https://joind.in/talk/4f722
(QR-Code (opens in new window))
Imagine, if you will, a world where you're able to define a tailor-made type for domain objects that is always valid, type-safe, immutable, and easy to test. No more email addresses passed around as plain strings, nor associative arrays being passed around with potentially-undefined keys and unpredictable types.
In this session, we'll dive deep into PHP Value Objects: where are they useful, how do we write (and test!) them, and how do we ensure that the data they encapsulate is valid? Attendees will leave with a better understanding of domain modeling, Value Objects, and immutability.
Warning: once you start using proper value objects, you may never be able to go back to using anything else!
Comments
Please login to leave a comment
Value objects took me a long time to understand, mostly because I originally learned PHP using associative arrays for passing ALL data at all times. Understanding how to create my own types and leverage typed wrappers over primitive values changed the way I wrote code and opened the door to both other languages (i.e. Scala and Go) with stronger typing systems and to strictly-typed PHP. Steve's presentation of the concept helps make value objects incredibly approachable for all levels of engineers and is the talk I wish I'd seen years ago when I was first learning (and failing to understand) object-oriented programming.
Taking the time to cover testing also helps anyone just now embarking on this journey to avoid the ever-present footguns that make OOP difficult even for tenured/experienced engineers.
It made a strong argument for using value objects
Great talk,
I’ve been trying to find better ways of communicating the value of value objects to other developers and this talk really helped me find new ways to do that. Really appreciate the Laravel example.
Great presentation. Steve seemed to has a really clear picture of who his audience was and nailed it. Kept things technical without getting too lost in the weeds which can be a hardline to draw!
very useful concept that i had losely implemented before but hadnt thought of as a complete topic on its own. hopefully will be using this for more things
Steve made it REALLY easy to understand value objects, and the benefits of using them. Was easy to follow the presentation from start to finish and really appreciated how easy it was to learn.