title: DDD Hexagon - Should the Domain Layer ever talk to the Infrastructure (DAL) Layer in any situation?
body: <p>As I understand it, one of the key rules of Hexagonal Architecture is how the Domain Layer is isolated from everything except the Application Layer which works with it (the Domain Layer has no dependencies at all as it sits in the core):</p>
  <p><a href="https://i.stack.imgur.com/gPKrg.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gPKrg.jpg" alt="enter image description here" /></a></p>
  <p>My question is then, does the Domain Layer ever do any work or have any knowledge of data persistence whatsoever? Suppose we have some business logic which depends on data being retrieved and then persisted, should it <strong>always</strong> be the <strong>Application Layer</strong> which is orchestrating this?</p>
  <p>Load everything required for the business logic to run -&gt;
  Tell the Domain Layer to run all the business logic -&gt;
  Extract the results of the business logic and tell the Infrastructure Layer to persist them -&gt;</p>
  <p>In this sense, wouldn't the Application Layer always need to keep track of any result the Domain Layer has calculated, and therefore would always implement some kind of UnitOfWork pattern to track these results?</p>
  <p>Would the Domain Layer ever work with a repository, or an interface of a repository whatsoever? There are some sources which seem to suggest this is fine, which completely contradicts the diagram from my perspective.</p>