Considering Domain Driven Design, can Infrastructure or System use Domain's objects (Values, Entities, etc.), or should it be applied Dependency Inversion, so that Infrastructure will only depend on Interfaces defined by itself?
What about the Repository? Does it applies de same?
Is it a violation to a Infrastructure, Repository or a System code depends on the Domain?
(A) Example code where Infrastructure depends on the Domain:
namespace Infrastrcuture {
public class Sender {
public void Send (Domain.DataValue data) { ... }
}
}
(B) Example code where Infrastructure will not depend on the Domain:
namespace Infrastrcuture {
public interface ISendableData {
...
}
public class Sender {
public void Send (ISendableData data) { ... }
}
}