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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:07:48+00:00 2026-06-14T21:07:48+00:00

I am just starting out with domain driven design and have a project for

  • 0

I am just starting out with domain driven design and have a project for my domain which is structured like this:

Domain

  • /Entities
  • /Boundaries
  • /UserStories

As I understand DDD, apart from the boundaries with which the outside world communicates with the domain, everything in the domain should be invisble. All of the examples I have seen of entity classes within a domain have a public access modifer, for example here I have a entity named Message:

public class Message
{        
        private string _text;

        public string Text
        {
            get { return _text; }
            set { _text = value; }
        }

        public Message()
        {

        }

        public bool IsValid()
        {
           // Do some validation on text
        }
}

Would it not be more correct if the entity class and its members were marked as internal so it is only accessible within the domain project?

For example:

internal class Message
{        
        private string _text;

        internal string Text
        {
            get { return _text; }
            set { _text = value; }
        }

        internal Message()
        {

        }

        internal bool IsValid()
        {
           // Do some validation on text
        }
 }
  • 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-14T21:07:49+00:00Added an answer on June 14, 2026 at 9:07 pm

    I think there’s a confusion here: the Bounded Context is a concept which defines the context in which a model is valid there aren’t classes actualy named Boundary. Maybe those are objects for anti corruption purposes, but really the Aggregate Root should deal with that or some entry point in the Bounded Context.

    I wouldn’t structure a Domain like this, this is artificial, you should structure the Domain according to what make sense in the real world process. You’re using DDD to model a real world process in code and I haven’t heard anyone outside software devel talking aobut Entities or Value Objects. They talk about Orders, Products, Prices etc

    Btw that Message is almost certain a value object, unless the Domain really needs to identify uniquely each Message. Here the Message is a Domain concept, I hope you don’t mean a command or an event. And you should put the validation in the constructor or in the method where the new value is given.

    In fairness this code is way to simplistc, perhaps you’ve picked the wrong example. About the classes being internal or public, they might be one or another it isn’t a rule, it depends on many things. At one extreme you’ll have the approach where almost every object is internal but implements a public interface common for the application, this can be highly inefficient.

    A rule of the thumb: if the class is used outside the Domain assembly make it public, if it’s something internally used by the Domain and/or implements a public interface, make it internal.

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

Sidebar

Related Questions

Just starting out in Unix and need t workout this:- I have a csv
Just starting out with HAML, how do I convert this? <div class=fb-like data-href=http://localhost:3000 data-send=true
I am just starting out with Lucene, and I feel like I must have
Just starting out with subversion, have set up repos for 3 current projects and
Just starting out, this should be a simple one but I haven't been able
I am just starting out on functions in PostgreSQL, and this is probably pretty
Just starting out with C#, so this may be overly simple that I keep
Just starting out with my first commercial app for the iStore but dont have
Only just starting out with jQuery and I'm sure this is basic stuff for
I am just starting out with android. I downloaded a sample project. And getting

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.