Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <blockquote> <p>Repository Coordination?</p> </blockquote> <p>Aggregate roots should draw transactional boundaries. Therefore - multiple repositories should rarely be involved. If they are - that usually happens when You are <strong>creating</strong> new aggregate root (as opposed to modifying its state).</p> <hr> <blockquote> <p>Business Logic that Involves Repositories?</p> </blockquote> <p>Yes, checking if username is distinct might live in service layer. Because User usually is an aggregate root and aggregate roots live in global context (there is nothing that "holds" them). I personally put that kind of logic in repository or just check directly through ORM.</p> <p>As for checking password usage - that's a concern of user itself and should live underneath User object. Something like this:</p> <pre><code>class User{ void Login(){ LoggedOn=DateTime.Now; ... } bool HasLoggedInLast90Days(){ return (DateTime.Now-LoggedOn).Days&lt;=90; } } </code></pre> <hr> <blockquote> <p>Business Logic that Involves Multiple Entities?</p> </blockquote> <p>Aggregate root should manage their entity collections.</p> <pre><code>class Customer{ void OrderProduct(Product product){ Orders.Add(new Order(product)); //&lt;-- } } </code></pre> <p>But remember that aggregate root should not micro-control its entities.</p> <p>E.g. this is bad:</p> <pre><code>class Customer{ void IsOrderOverdue(Order order){ return Orders.First(o=&gt;o==order)....==...; } } </code></pre> <p>Instead use:</p> <pre><code>class Order{ void IsOverdue(){ return ...; } } </code></pre> <hr> <blockquote> <p>Mapping?</p> </blockquote> <p>I suppose mapping to dto`s live in service layer. My mapping classes lives next to view model classes in web project.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload