Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8248819
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T23:19:36+00:00 2026-06-07T23:19:36+00:00

I have a relatively simple domain model, as shown by the diagram. I would

  • 0

I have a relatively simple domain model, as shown by the diagram. I would like to maintain this logic within my domain objects as defined by DDD.

Each domain object is an abstract class which only contains its respective members and domain logic. Concrete implementations of these classes are returned by the repositories, supplied to the service (with DI).

What I am having trouble with is understanding how to deal with the situation that I need to create a new entity. For example the domain logic dictates:

An account can be added to a Group (creating a Member entity).

  • When an account is added to a group, the new Member entity’s Value property must be set to the total number of members that are already in the Group.

  • Every other member of the Group must have their value
    incremented by 1.

I could implement this as a Member AddMember(Account account) method on Group. However this method will somehow need to instantiate a new Member to add to the Group’s Members collection.

As the domain object’s have no references to the layers further up in the application, and the domain objects themselves are abstract, I’m unsure how to go about constructing the new instance of Member.

I have considered the possibility of defining an abstract protected Member CreateMember() method on the Group object that concrete implementations can implement but this seems messy to me and concerns me that I may be misunderstanding something more fundamental.

While trying to stay true to DDD principles, how would I go about implementing this model?

Domain Entity Diagram

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T23:19:39+00:00Added an answer on June 7, 2026 at 11:19 pm

    You probably want to create a MemberFactory (as a Domain Service) that has the responsibility of creating new Member objects. See this answer for a great example.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a relatively simple Rails app and I would like to store various
I have a relatively simple HTML / JavaScript form. Such as this: <form method='POST'
I have this relatively simple regex for usernames // Enforce that username has to
I have a relatively simple Soap response message XML which I'd like to modify
I have a relatively simple entries model with just five fields: id type (what
I have a relatively simple pthread program on Linux. For this purpose, I've stripped
I have a relatively simple object with a method that makes an HTTP request.
I have a relatively simple question. Will using PHP guarantee that a form is
I have two relatively simple codes. One main activity and one intent service. Main
I have a relatively simple class which deletes a post: function delete_post($postid, $reason){ //Stuff

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.