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

  • Home
  • SEARCH
  • 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 8333037
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T02:53:20+00:00 2026-06-09T02:53:20+00:00

I have a Domain that I generate using Entity Developer. This creates all of

  • 0

I have a Domain that I generate using Entity Developer. This creates all of my Entities and my Database tables. I use NHibernate to populate my Entities which are exposed via Repositories. I then have a services layer that aggregates the Repositories into useful services. This layer is used in two ways. One, I use services as my only means of communication to and from my web layer and I want to someday use the services for WCF. Right now, I’m working on my web layer and I’m trying to figure out the best way to communicate with my services. My services are currently returning Entities. My web layer is grabbing these Entities via the services in the controllers. This is probably not very DRY/DDD. I’m assuming my services layer needs to interface via DTO’s. DTO’s would be perfect for my WCF services. As for my Web layer, I’m assuming that I would take the DTO’s that are returned from my services layer and I would want to map those to View Models (I’m using ASP.NET MVC 3).

So this is what my architecture would end up looking like:

Domain
  Entities
  Repository Interfaces
Infrastructure
  NHibernate
  Concrete Repositories
Services
  DTO's
  Concrete Services
  Service Interfaces
  IIS hosted WCF
Website
  ViewModels

And I would either use Automapper or ValueInjecter to do my mappings (probably ValueInjector due to the ability to flatten and unflatten my Entities/DTO’s.

So is this overkill? The system I’m using this architecture is quite large (I’m rewritting everything). Am I doing it right? Everything is decoupled dependency-wise with Ninject because I could see wanting to change out any part of the system at any time. Any thoughts, ideas or criticism is very welcome and appreciated.

  • 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-09T02:53:22+00:00Added an answer on June 9, 2026 at 2:53 am

    This is a common architecture and works well in practice. One central benefit is encapsulation – your domain is encapsulated by a service layer (application services in DDD).

    As far as WCF services, I believe a more appropriate term for them is adapter. This is based on the hexagonal architecture where you application service layer is at the core and WCF adapts HTTP (or other binding) to it. With this in mind, application services should be implemented in an adapter agnostic way. This means no WCF specific attributes or data contracts. The WCF adapters in turn are thin layers around application services. Some may consider this overkill because of the added layering, but I’ve found it beneficial because it keeps the application layer free of technology specific concerns.

    Whether this architecture is overkill depends on the project. One way to answer that question is to determine whether the application is mostly CRUD in which case DDD is overkill and it may be better to use a technology which facilitates reading from the database and exposing the data directly as a service.

    Take a look here for a more in-depth treatment of services within DDD.

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

Sidebar

Related Questions

I have this idea that using SQL VIEWS to abstract simple database computations (such
I have created a repository that is returning data from my database using Entity
I feel silly asking this question... Sometimes I have a domain that I want
Here is my problem: Domain: I have following Entities: [Sensor] that can be positioned
I have a custom entity in a relational database that I have mapped to
I have a db4o database that was generate by a Java app and I'm
We are using builder pattern to generate test data. These domain objects have relations
I have a grails project that contains a few domain objects. I am using
I have a domain object that has been auto generated for me by MyGeneration.
When you have a domain object that needs to display as an interface control,

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.