Skip to main content
deleted 20 characters in body
Source Link
Robert Harvey
  • 200.7k
  • 55
  • 470
  • 683

If you're only holding data in your Entities your domain model will become anemic, because the encapsulation is broken and the behaviors are all defined outside the entity, far from where the data are declared.

The whole point of the Clean Architecture (and the Hexagonal Architecture, Onion Architecture, etc.) is to promote the Dependency Inversion Principle, the D in the SOLID acronyme. To do that, the outer layers need to depend on the the inner layers, not the opposite. That's why it's not only ok but necessary that your interactors depend on your entities. But your entities should not depend on your interactors.

Testing interactors means testing a whole use case, so that's totally intended to execute the code in your entities !

Hope it helps :)

If you're only holding data in your Entities your domain model will become anemic, because the encapsulation is broken and the behaviors are all defined outside the entity, far from where the data are declared.

The whole point of the Clean Architecture (and the Hexagonal Architecture, Onion Architecture, etc.) is to promote the Dependency Inversion Principle, the D in the SOLID acronyme. To do that, the outer layers need to depend on the the inner layers, not the opposite. That's why it's not only ok but necessary that your interactors depend on your entities. But your entities should not depend on your interactors.

Testing interactors means testing a whole use case, so that's totally intended to execute the code in your entities !

Hope it helps :)

If you're only holding data in your Entities your domain model will become anemic, because the encapsulation is broken and the behaviors are all defined outside the entity, far from where the data are declared.

The whole point of the Clean Architecture (and the Hexagonal Architecture, Onion Architecture, etc.) is to promote the Dependency Inversion Principle, the D in the SOLID acronyme. To do that, the outer layers need to depend on the the inner layers, not the opposite. That's why it's not only ok but necessary that your interactors depend on your entities. But your entities should not depend on your interactors.

Testing interactors means testing a whole use case, so that's totally intended to execute the code in your entities !

added 2 characters in body
Source Link
candied_orange
  • 119.7k
  • 27
  • 233
  • 369

If you're only holding data in your Entities your domain model will become anemic, because the encapsulation is broken and the behaviors are all defined outside the entity, far from where the data are declared.

The whole point of the Clean Architecture (and the Hexagonal Architecture, Onion Architecture, etc.) is to promote the Dependency Inversion Principle, the D in the SOLID acronyme. To do that, the upper layerouter layers need to depend on the the lower layerinner layers, not the opposite. That's why it's not only ok but necessary that your interactors depend on your entities. But your entities should not depend on your interactors.

Testing interactors means testing a whole use case, so that's totally intended to execute the code in your entities !

Hope it helps :)

If you're only holding data in your Entities your domain model will become anemic, because the encapsulation is broken and the behaviors are all defined outside the entity, far from where the data are declared.

The whole point of the Clean Architecture (and the Hexagonal Architecture, Onion Architecture, etc.) is to promote the Dependency Inversion Principle, the D in the SOLID acronyme. To do that, the upper layer need to depend on the the lower layer, not the opposite. That's why it's not only ok but necessary that your interactors depend on your entities. But your entities should not depend on your interactors.

Testing interactors means testing a whole use case, so that's totally intended to execute the code in your entities !

Hope it helps :)

If you're only holding data in your Entities your domain model will become anemic, because the encapsulation is broken and the behaviors are all defined outside the entity, far from where the data are declared.

The whole point of the Clean Architecture (and the Hexagonal Architecture, Onion Architecture, etc.) is to promote the Dependency Inversion Principle, the D in the SOLID acronyme. To do that, the outer layers need to depend on the the inner layers, not the opposite. That's why it's not only ok but necessary that your interactors depend on your entities. But your entities should not depend on your interactors.

Testing interactors means testing a whole use case, so that's totally intended to execute the code in your entities !

Hope it helps :)

deleted 1 character in body
Source Link

If you're only holding data in your Entities your domain model will become anemic, because the encapsulation is broken and the behaviors are all defined outside the entity, far from where the data are declared.

The whole point of the Clean Architecture (and the Hexagonal Architecture, Onion Architecture, etc.) is to promote the Dependency Inversion Principle, the D in the SOLID acronyme. To do that, the upper layer need to depend on the the lower layer, not the opposite. That's why it's not only ok but necessary that your interactors dependsdepend on your entities. But your entities should not depend on your interactors.

Testing interactors means testing a whole use case, so that's totally intended to execute the code in your entities !

Hope it helps :)

If you're only holding data in your Entities your domain model will become anemic, because the encapsulation is broken and the behaviors are all defined outside the entity, far from where the data are declared.

The whole point of the Clean Architecture (and the Hexagonal Architecture, Onion Architecture, etc.) is to promote the Dependency Inversion Principle, the D in the SOLID acronyme. To do that, the upper layer need to depend on the the lower layer, not the opposite. That's why it's not only ok but necessary that your interactors depends on your entities. But your entities should not depend on your interactors.

Testing interactors means testing a whole use case, so that's totally intended to execute the code in your entities !

Hope it helps :)

If you're only holding data in your Entities your domain model will become anemic, because the encapsulation is broken and the behaviors are all defined outside the entity, far from where the data are declared.

The whole point of the Clean Architecture (and the Hexagonal Architecture, Onion Architecture, etc.) is to promote the Dependency Inversion Principle, the D in the SOLID acronyme. To do that, the upper layer need to depend on the the lower layer, not the opposite. That's why it's not only ok but necessary that your interactors depend on your entities. But your entities should not depend on your interactors.

Testing interactors means testing a whole use case, so that's totally intended to execute the code in your entities !

Hope it helps :)

Source Link
Loading