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 8031859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T01:13:52+00:00 2026-06-05T01:13:52+00:00

To Domain-Driven development experts out there… I am trying to really grasp the concept

  • 0

To Domain-Driven development experts out there…

I am trying to really grasp the concept of DDD. So far I have been designing my models to be data driven rather than domain driven. I have read a couple of articles about DDD and seemed really interesting, especially for large-scale applications. So I am trying to tailor my models to do exactly that.

I have say a customer entity that exposes a method FreezeAccounts which would disable all customer accounts. This method is not concerned with data access (based on the Persistence Ignorance rule). It updates a flag on each customer account (which is loaded on demand) and saves changes to a database. Is that correct based on this model? I have read that in DDD there is not necessarily just one class per table entity. Should this functionality be in a separate class? Here is some sample code:

public class Customer : ICustomer, ICustomerAction
{
    #region Initialization
    public Customer()
    {
    }

    internal Customer(ICustomer view)
    {
        this.CustomerId = view.CustomerId;
        this.Name = view.Name;
        this.Email = view.Email;
        this.IsActive = view.IsActive;
    }
    #endregion

    #region Instances

    private AccountCollection _accounts;

    #endregion

    #region Properties

    #region ICustomer

    public int CustomerId { get; private set; }
    public string Name { get; set; }
    public string Email { get; set; }

    #endregion

    #region Derived

    public AccountCollection Accounts
    {
        get
        {
            if (_accounts == null)
                _accounts = Account.GetListByCustomerId(CustomerId);
            return _accounts;
        }
    }

    #endregion

    #endregion

    #region Methods

    #region CRUD

    // Data Access Object accepts interface ICustomer
    internal void Update()
    {
        CustomerDb.Update(this); 
    }

    #endregion

    #region ICustomerAction

    // Exposed business Persistence Ignorance action
    internal void FreezeAccounts()
    {
        foreach (Account account in this.Accounts)
        {
            account.IsEnabled = false;
            account.Update();
        }
    }

    #endregion

    #endregion
}
  • 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-05T01:13:54+00:00Added an answer on June 5, 2026 at 1:13 am

    First of all, in DDD as in other architectures, the Data Access Layer must be separated from the domain and the business logic, so no CRUD operations into the entity.

    So to answer, yes, create a separate layer (no only a class) to read/write data on the storage, in particular in DDD you can use the Repository and Unit Of Work patterns by Martin Fowler.

    If you want an example of DDD look here.

    Note: I’ve to publish a new revision of my DDD architecture “view” on NuGet.

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

Sidebar

Related Questions

I am trying to use Domain Driven Development (DDD) for my new ASP.NET MVC2
While I have been dealing with domain-driven design (DDD) for quite some time now,
I have been building a new application using my current understanding of domain driven
I've been doing some reading on Domain Driven Development but can't see how this
I'm trying to do things the DDD (domain driven design) way. And boy do
I'm trying to learn more about Domain Driven Development including the Repository pattern, Unit
I have just been re-reading Domain-Driven Design: Tackling Complexity in the Heart of Software
Is there a .NET porting of Domain Driven Design's Time and Money project?
I'm trying to explore Behavior Driven Design and Domain Driven Design. I'm getting that
Are there any free video training resources for Domain Driven Design ?

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.