• douglasg14b@programming.dev
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    1 year ago

    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.

    • canpolat@programming.devOP
      link
      fedilink
      English
      arrow-up
      0
      ·
      1 year ago

      I agree that this is a solution looking for a problem. I still think the way he explores the limits of the language is food for thought. And the fact that this is at all possible makes C# a fun language to work with.