title: DDD Ports and Adapters with Onion architecture, what goes where?
body: <p>trying to figure out some concepts and haven't been able to understand </p>
  
  <p>What is a use-case in the Ports and Adapters architecture ? </p>
  
  <p>What an implementation of a use-case would look like ? </p>
  
  <p>What is a use-case concern ?</p>
  
  <p>Where does it fit in the Infrastructure or Domain, it says it goes in the Application, well there is the Application Core and the Application Service which from my understanding are different ? </p>
  
  <blockquote>
    <p>On the left side, the adapter depends on the port and gets injected a
    concrete implementation of the port, which contains the use case. On
    this side, both the port and its concrete implementation (the use
    case) belong inside the application;</p>
  </blockquote>
  
  <p><a href="https://herbertograca.com/2017/09/14/ports-adapters-architecture/#what-is-a-port" rel="noreferrer">https://herbertograca.com/2017/09/14/ports-adapters-architecture/#what-is-a-port</a></p>
  
  <p>This quote confuses me ... because from what I understand a Primary Adapter can be anything that is asking for your business logic (it is interested in what you provide) WebAPI, MVC, Testing, ConsoleApp. </p>
  
  <blockquote>
    <p>On the left side, the adapter depends on the port and gets injected a
    concrete implementation of the port which contains the use case. </p>
  </blockquote>
  
  <p>So I assume that it refers to your business logic being injected in let;s say a WebApiController Constructor </p>
  
  <blockquote>
    <p>On this side, both the port and its concrete implementation (the use
    case) belong inside the application;</p>
  </blockquote>
  
  <p>So what ? who is this </p>
  
  <blockquote>
    <p>application</p>
  </blockquote>
  
  <p>Is it the WebApi ? or is the Domain ? also the use-case from what I understand is the implementation of my business logic, so for example the design would be something like this ?</p>
  
  <pre><code>Client :
  WebApiController(IMyBusinessServicePort service)
  
  Infrastructure :
  ImplementingPrimaryAdapter : IMyBusinessServicePort { }
  ImplementingSecondaryAdapter : ILoggingPort { }
  
  Domain :
  ImplementMyBusinessLogicService : IMyBusinessLogicService 
  </code></pre>
  
  <p>So WebApiController will use the implementation provided by ImplementingPrimaryAdapter and not something from my domain ? I don;t understand </p>
  
  <p>please explain .</p>