Download the source code for this demo at Patreon: https://www.patreon.com/posts/one-thing-you-do-85222122In Object-Oriented Programming, objects are instanc...
Isn’t this an entire class of problems that’s avoidable by using strict DDD-style entities?
You don’t have the same “purists” OOP problems, you don’t have extension methods to get lost in, you don’t have publicly mutable state, and you have a clear surface area for state changes. And your ORM is happy.
Purists OOP has all sorts of issues, more procedural, pragmatic, approaches can alleviate that pain. And strict entities provide the same surface area as the functional approach, without concerns over breaking ORM tracking. With the added benefits of closely guarding local state.
Opinion time.
This is less “what you can’t do in OOP” and more “what you can’t do if you use OOP design as dogma” 🤔. Perhaps that’s an important distinction to make, depending on your viewership, but to me this feels like a solution looking for a contrived problem.
Isn’t this an entire class of problems that’s avoidable by using strict DDD-style entities?
You don’t have the same “purists” OOP problems, you don’t have extension methods to get lost in, you don’t have publicly mutable state, and you have a clear surface area for state changes. And your ORM is happy.
Purists OOP has all sorts of issues, more procedural, pragmatic, approaches can alleviate that pain. And strict entities provide the same surface area as the functional approach, without concerns over breaking ORM tracking. With the added benefits of closely guarding local state.
Opinion time.
This is less “what you can’t do in OOP” and more “what you can’t do if you use OOP design as dogma” 🤔. Perhaps that’s an important distinction to make, depending on your viewership, but to me this feels like a solution looking for a contrived problem.