title: What object i should have in command?
body: <p>I writing system following hexagonal architecture.</p>
  
  <p>I have asynchronous commands and synch query objects split in UseCase.</p>
  
  <p>My src folder look like:</p>
  
  <pre><code>-src
  --Entity
  ---Task.php
  --UseCase
  ---Command
  ----CreateTask
  -----CreateTaskUseCase.php
  -----CreateTaskCommand.php
  </code></pre>
  
  <p>My Question is: What i can/should use to send data via Command in constructor of <code>UseCase\Command\CreateTask\CreateTaskCommand</code></p>
  
  <ul>
  <li><code>\Entity\Task</code> </li>
  <li>create <code>UseCase\Command\CreateTask\Request\Task</code> that would have all needed data</li>
  <li>only string/int/float </li>
  </ul>
  
  <p>This is trivial example to show problem.</p>
  
  <p>Right now i'm using object from Domain (<code>Entiti\Task</code> etc)
  In real situation, i have <code>UseCase\Command\CreateProcess</code> that need </p>
  
  <ul>
  <li>Uuid</li>
  <li>Instance[id, name]</li>
  <li>Source[node_id, node_name, leaf_id, leaf_name]</li>
  <li>Resource[id,name,type etc. normal types Person[name,lastname]]</li>
  </ul>
  
  <p>By following DDD, Process is my aggregate. All entities exists only due construct Process(Node,Leaf,Resource,Person). Then i don't want separate way, to create the others entities, because that way works my business logic.</p>
  
  <p>Due that problem, question is: what should i to choose? Breaking some rules?</p>
  
  <p>Problems:</p>
  
  <ul>
  <li>bind command with Object from inside Domain, will bind higher layer more to core. Any change in core, will chain react with all layers</li>
  <li>Creating <code>Request\*</code> make me alot of classes, but clear way of use command, and much more work - unitTest etc.</li>
  <li>Using only standard type(int,string etc.) will make __counstruct with 20 arguments. I don't want multilevel array, as will no be clear of use this command.</li>
  </ul>
  
  <p>Thanks for help. </p>