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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:22:59+00:00 2026-05-29T09:22:59+00:00

Folks, Apologies if this has been covered in another thread, but I have searched

  • 0

Folks,
Apologies if this has been covered in another thread, but I have searched ddd and mvc articles and have not found a straightforward answer.

I am hoping to apply a DDD approach to the architecture of my MVC projects. Please correct me where I am wrong.

All MVC controller actions that involve hitting the domain model will initially hit
and application service layer.
The application service layer here acts as a facade between presentation and the domain.
Any requests from the application service later that clearly involve discrete domain aggregates will perform fetch or modify operations on aggregate roots using repositories. Each aggregate root will have its own repository.

so the application service layer must be injected with any/all repositories required by the domain.

Where an operation may involve multiple aggregates or requires logic that does not fit neatly into one aggregate, the application service will call a domain service to carry out operations across aggregates.

This does not seem right to me.
My confusion is that from a DDD perspective Im not sure whether for example aggregate roots should perform their own persistance i.e. the aggregate gets injected with a repository and then persists/fetches itself or whether as above the application service layer uses repositories to act on or fetch aggregates?

Also if the application service layer is injected with all repositories, does the domain service that the application service layer calls also need repositories injected?

Im keeping CQRS out of this at this point. I want to get the layering and the relationship between services and aggregates sorted out first.

Thanks for any advice.

  • 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-29T09:23:00+00:00Added an answer on May 29, 2026 at 9:23 am

    All MVC controller actions that involve hitting the domain model will
    initially hit and application service layer. The application service layer here acts as a facade between presentation and the domain.

    There’s debate over that but I would consider carefully whether that additional layer is needed or not. It adds a lot of boilerplate code and degrades maintainability – as someone pointed out recently, when you separate things that change for the same reasons (ie your service methods and the corresponding domain methods), you have to make changes in many different places in the system.

    On the other hand, you could need that service layer to map your domain objects to DTOs but there again, it could be done directly in the Controller and nothing forces you to use DTOs in the presentation layer.

    My confusion is that from a DDD perspective Im not sure whether for
    example aggregate roots should perform their own persistance i.e. the
    aggregate gets injected with a repository and then persists/fetches
    itself or whether as above the application service layer uses
    repositories to act on or fetch aggregates?

    It’s usually considered bad practice to have aggregate roots manage their own persistence because it breaks persistence ignorance and violates the Single Responsibility Principle. If you do that, your aggregate root class now has 2 reasons to change, 2 reasons to break the code, it is less maintainable, etc.

    You should instead delegate the responsibility of saving the aggregate root in its repository to an object that will be aware of the application execution context (for instance, a Controller or an object in the Application layer).

    Also if the application service layer is injected with all
    repositories, does the domain service that the application service
    layer calls also need repositories injected?

    Yes, I think it pretty much makes sense especially if the domain service heavily relies on the repository.

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

Sidebar

Related Questions

I apologize in advance if folks think this has been beaten to death. I've
folks! I have project in cc.net and this project nay start by 3 ways
Folks I have a sealed class as follows. I want to extend this sealed
Folks, We have been using OpenXml APIs found in System.IO.Packaging for creating a package
I apologize in advance for this somewhat ignorant question, but I have researched this
Folks, I have this array: var list = new Array('Archer','Archer','Banker','Lantern','Toryboy','The Barb','Tim Whiffler','Glencoe','Warrior','Nimblefoot','The Pearl','The Quack','Don
Folks, I had a quick question about Amazon EC2, I have been recently using
Folks, I have ASP.NET MVC 3 Application and I have the following JQuery script
Folks, I have android application that presently has 1 warning, in line 80 of
Folks, I have an hourly temperature data like this Lines <- Date,Outdoor,Indoor 01/01 01:00:00,24.5,21.3

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.