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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:11:16+00:00 2026-06-13T01:11:16+00:00

I am working on a large-scale system for a telecom company. I am new

  • 0

I am working on a large-scale system for a telecom company. I am new to DDD and having hard time linking different pieces together. Our current system is build using NHibernate. It currently has well over 600 tables and all data access is done using NHibernate but for the new system we will be using EF. Below are few functional areas and examples of database tables in each functional area.

Customers
—–> CustomerDemographics
—–> CustomerPayments
—–> CustomerTransactions

RoutingEngine
—–> InboundRoutes
—–> OutboundRoutes

ProvisioningEngine
—–> InboundSwithces
—–> OutboundSwitches
—–> RouterConfigs
—–> GatewayConfigs

BillingEngine
—–> InboundTraffic
—–> OutboundTraffic

Since the system has to be unit-testable, I started abstracting actual entities with a repository pattern. One approach is to create one repository object for each each database table. Of course all these repository classes could be derived from a generic repository interface. However this will be adding quite a bit of overhead in terms of code base maintenance. In DDD, I read about this concept of Aggregates but I am not sure how it should be applied specially in context of EF. Should the Aggregate objects are container of these repositories or are these more of a container of related contexts (meaning something along the lines of Bounded DbContexts)?

  • 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-13T01:11:17+00:00Added an answer on June 13, 2026 at 1:11 am

    One approach is to create one repository object for each each database
    table.

    In DDD, with the notion of persistence ignorance, database tables typically aren’t in a one-to-one mapping with repositories. Instead, repositories should be one-to-one with aggregates.

    Of course all these repository classes could be derived from a generic
    repository interface.

    The repository pattern can be a slippery slope. While it is great for encapsulation, it is easy to get carried away with needless abstraction. Take a look here for an alternative perspective.

    Should the Aggregate objects are container of these repositories or
    are these more of a container of related contexts (meaning something
    along the lines of Bounded DbContexts)?

    It seems that what you call “functional areas” are called bounded contexts (BC) in DDD. (Not DbContext in EF). Also, aggregates aren’t containers of repositories, they contain a group of related entities from your domain model. The stereotypical example is the sales order model where you have an order aggregate which consists of the order aggregate root and various entities and value objects such as order line items. As stated above, aggregates are the domain objects which repositories should provide access to. Therefore, you should structure your repositories around aggregates, but of course first you have to identify your aggregates and BCs. Take a look at Effective Aggregate Design by Vaughn Vernon.

    Also, Having 600 tables in a single BC seems like too much and is a potential sign that you have multiple BCs at play. What BCs achieve is functional cohesion, which in turn is most fitting way to group (“aggregate” conflicts with DDD term) your repositories.

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

Sidebar

Related Questions

I'm working on a large scale software system written in Python right now, which
I am working on a large scale ASP.NET web app. The system is large
I am working on a large scale application. I carefully try to handle all
I am working on a large scale project where a custom (pretty good and
The project that I'm currently working on, is large scale. I'm using email activation
After working with a lot of GD recently (for some fairly large scale projects
I’ve been working on a few small scale Access projects that have turned large
So I am working an a large scale application. We are in the process
I am working on a large-scale checkout application for a current project. This checkout
I have a large scale project I am working on at the moment using

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.