Skip to main content
added 39 characters in body
Source Link
radarbob
  • 5.9k
  • 22
  • 34

There seems to be a mindset that "DTO" is sacrosanct, clouding the OP's impulse to apply Single Responsibility principle due to conflating DDD framework and business domain model. Make a proper object of data AND function/behavior. Of course a proper domain object is still that if it has a method returning a DTO - a generic, non business/domain utility thing.

Thus the domain object is decoupled from any specific respository makingand the DDD framework more generally, making other refactoring goals possible.

There seems to be a mindset that "DTO" is sacrosanct, clouding the OP's impulse to apply Single Responsibility principle due to conflating DDD framework and business domain model. Make a proper object of data AND function/behavior. Of course a proper domain object is still that if it has a method returning a DTO - a generic, non business/domain utility thing.

Thus the domain object is decoupled from any specific respository making other refactoring goals possible.

There seems to be a mindset that "DTO" is sacrosanct, clouding the OP's impulse to apply Single Responsibility principle due to conflating DDD framework and business domain model. Make a proper object of data AND function/behavior. Of course a proper domain object is still that if it has a method returning a DTO - a generic, non business/domain utility thing.

Thus the domain object is decoupled from any specific respository and the DDD framework more generally, making other refactoring goals possible.

added 110 characters in body
Source Link
radarbob
  • 5.9k
  • 22
  • 34

There seems to be a mindset that "DTO" is sacrosanct, clouding the OP's impulse to apply Single Responsibility principle due to conflating DDD framework and business domain model. Make a proper object of data AND function/behavior. Of course a proper domain object is still that if it has a method returning a DTO - a generic, non business/domain utility thing.

Thus the domain object is decoupled from any specific respository making other refactoring goals possible.

There seems to be a mindset that "DTO" is sacrosanct, clouding the OP's impulse to apply Single Responsibility principle due to conflating DDD framework and business domain model. Make a proper object of data AND function/behavior. Of course a proper domain object is still that if it has a method returning a DTO - a generic, non business/domain utility thing.

There seems to be a mindset that "DTO" is sacrosanct, clouding the OP's impulse to apply Single Responsibility principle due to conflating DDD framework and business domain model. Make a proper object of data AND function/behavior. Of course a proper domain object is still that if it has a method returning a DTO - a generic, non business/domain utility thing.

Thus the domain object is decoupled from any specific respository making other refactoring goals possible.

Source Link
radarbob
  • 5.9k
  • 22
  • 34

There seems to be a mindset that "DTO" is sacrosanct, clouding the OP's impulse to apply Single Responsibility principle due to conflating DDD framework and business domain model. Make a proper object of data AND function/behavior. Of course a proper domain object is still that if it has a method returning a DTO - a generic, non business/domain utility thing.