title: Aggregate design for user / follower using clean architecture
body: <p>I try to follow the clean architecture principals and I was wondering what's the best approach for the following problem.</p>
  <h2>The business rules</h2>
  <p>Let's say I have users that can follow each other and I want to save the specific time where the action has occurred.
  A user cannot follow itself nor a user that it has already followed.</p>
  <h2>What I did</h2>
  <pre class="lang-cs prettyprint-override"><code>// user aggregate
  
  public class User : IAggregateRoot
  {
      public Guid Id { get; init; } = Guid.New();
      public string Nickname { get; init; }
  }
  
  // follower aggregate
  
  public class Follower : IAggregateRoot
  {
      private readonly List&lt;Follow&gt; _follows = new();
  
      public Guid Id { get; init; } = Guid.New();
      public Guid UserId { get; init; }
  
      public void Follow(Guid userId)
      {
          if (userId == UserId)
              throw new Exception(); // sample Exception for the sake of brevity 
         
          if (_follows.Any(f =&gt; f.UserId == userId))
              throw new Exception(); // sample Exception for the sake of brevity 
          
          var follow = new Follow { UserId = userId, FollowedAt = Datetime.UtcNow };
          _follows.Add(follow );
      }
  }
  
  public class Follow
  {
      public Guid Id { get; init; } = Guid.New();
      public Guid UserId { get; init; }
      public Datetime FollowedAt { get; init; }
  }
  </code></pre>
  <h2>My questions</h2>
  <ol>
  <li><p>By splitting the classes in terms of business rules, how can I ensure there is a most one <code>Follower</code> by user ?</p>
  </li>
  <li><p>How much should I keep my aggregates separated ? As far as I understood, if I wanted to allow my users to publish a few pictures, I should create a new <code>Gallery</code> aggregate. Am I right ?</p>
  </li>
  <li><p>Should <code>Follow</code> by a value object rather than an child entity as it does not contain any logic ?</p>
  </li>
  </ol>