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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T08:39:49+00:00 2026-05-16T08:39:49+00:00

I’m in the process of trying to learn Domain Driven design so i’m sure

  • 0

I’m in the process of trying to learn Domain Driven design so i’m sure this will be the first of many questions (i can already think of at least a couple more but i don’t want to fragment my questions). I’m using Dino Esposito’s “Architecting Microsoft .NET Solutions for the Enterprise” which, in some cases, is very abstract.

First of all, i always assumed your business objects would have some type of connectivity (passed in through the constructor) whether it be a repository or DBConnection or whatever. Looks like i’m wrong.

Do you just construct your domain object by a combination passing in ALL the data and maybe some add/remove functions for the underlying collections (Order–>OrderDetails)? So in your DataMapper you would construct the buisness objects from the tuples in your DB and then return them to an application layer through a repository where you would use them? Then both your application layer & DL would need a reference to your Business objects. This would of course force you to build in your own lazy loading mechanism if your not using an ORM or maybe even if your using an ORM because you would be disconnected at this point. You wouldn’t want to load ALL the underlying data in all circumstances of course.

  • 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-05-16T08:39:50+00:00Added an answer on May 16, 2026 at 8:39 am

    According to domain driven design – domain objects are persistence ignorant. That means – they shouldn’t contain infrastructure code that connects to database. However – repository abstractions are considered as part of domain model. Therefore – it’s ‘allowed’ to use those, but I personally like to avoid that.

    If You are talking about modeling of domain objects – then no, mostly it’s not a good thing to model them as dumb data bags. That leads to anemic model.

    If You are talking about reconstructing domain objects when they are retrieved from persistence mechanisms, then Yes – basically that’s just rebuilding domain object from scratch. But tricky part here is – this rebuilding and other persistence related issues should not invade into Your domain. You should not have public add/remove functions without any validations just to make Your persistence to work. In reality – it’s hard to keep model completely clean (in fact, it’s already messed up with programming language You are using and there does not exist pure medium that could hold it, apart from reality You are modeling itself) and there will always be some implicit dependencies (e.g. – everything must be marked virtual when using NHibernate ORM).

    But You aren’t focusing on what You should in case You want to understand domain driven design. Core of domain driven design is ubiquitousness in language and explicitly modeled business. It’s about way You think. Start with reading ‘blue book’. Twice. And check out this sample application by Szymon Pobiega until You understand reason behind those lines of code.

    EDIT: Oh… forgot about ddd yahoo group which is quite nice source of info too.


    One thing that confuses me in your post is about you shouldn’t “Model” them as dumb property bags but in “reconstructing” then its ok.

    Take a look at this (oversimplified and bad one) example. From client side, unless You are cheating, You won’t be able to create a new Person that has name.Length>50.

    public class Person{
      public Person(string name){ 
          if (name.Length>50) throw new ArgumentException
            ("Person name length should not exceed 50 characters");  
          Name=name;
        }
        public string Name {get;private set;}
    }
    

    But when we reconstruct object from persistence mechanisms – cheating is exactly what we do. We bypass validation, we set data directly, we bypass object behavior because data is what represents state. E.g. using reflection:

    typeof(Partner).GetProperty("Name").SetValue(partner,nameFromDB);
    

    It sounds like its a very complex topic and probably a lot of people who think the are using domain-driven design..aren’t

    Domain driven design at start is truly confusing. And worst thing what could happen (and usually happens) is when developer starts to believe out of nowhere that he is doing it right (been there myself. might be I’m still there):

    And… is the Domain-Driven Design used in .NET pop culture really Domain-Driven Design in fact

    That leads to lot of confusion and falsehood. Some try to explain why. Some just hate it.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I know there's a lot of other questions out there that deal with this
Does anyone know how can I replace this 2 symbol below from the string
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I have a jquery bug and I've been looking for hours now, I can't
Basically, what I'm trying to create is a page of div tags, each has

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.