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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T10:20:12+00:00 2026-05-20T10:20:12+00:00

I am using the UnitOfWork/Service Layer/Repository/EF4 w/POCO design in my MVC app. So far

  • 0

I am using the UnitOfWork/Service Layer/Repository/EF4 w/POCO design in my MVC app.

So far I have this:

1) MVC Web App (Project.dll)
2) Service Layer (Project.Data.Services.dll)
3) Repository Layer (Project.Data.Repositories.dll)
4) POCOS (Project.Data.Domain.dll)
5) EF4/Context Layer (Project.Data.dll)

Each layer only reference the layer beneath and the Project.Data.Domain (POCO Classes).

I currently have the UnitOfWork Interface/Base in the Project.Data.dll, but now all the layers have to reference that. Is that a bad design? And if so, where does it live?

  • 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-20T10:20:13+00:00Added an answer on May 20, 2026 at 10:20 am

    It’s just an opinion.

    Domain objects are part of business. Same for contextes and repositories.

    In fact, my point is OR/M is an abstraction over a relational database or other kind of stores so these can act as an object-oriented store.

    That’s OR/M throws away data layers in modern software solutions.

    Repositories, domain context, domain objets are part of business layer.

    Unit of work is a software design pattern and it’s not only for working with databases, or a data layer, but it can manage more things, like a networked transaction. I’d suggest this should be included in some namespace like “YourCompany.YourProject.Patterns.UnitOfWork” or something like that.

    A service has nothing to do with data. I’d like to suggest a “YourCompany.YourProject.Services” namespace.

    Another point is your POCOs seems to work as DTO too, because you’re using everywhere, even for passing data through layers and/or tiers. This could be ok in a naked objects implementation or something like that, but you’ll need to pay attention to the fact of using domain objects as DTO, because they may contain properties, information, behaviors or OR/M proxying hidden members that may affect objects’ weight – memory usage -.

    Taking last paragraph fact, I’d suggest you to work with DTO in any layer on top of business, so your services would return DTOs with the specific range of properties that service consumers would need to work fine.

    DTO, patterns’ implementations and such things shared in all projects part of your solution should be living in some project called “YourProject.Shared” and this assembly mustn’t reference to any layer: it must remain layer-neutral, so referencing it everywhere doesn’t force to have useless dependencies.

    Well, this is my opinion and way of working in my projects.

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

Sidebar

Related Questions

I have a MVC app using the UnitOfWork, Service Layer, Repository Pattern and EF4
I'm developing an application using asp.net mvc, NHibernate and DDD. I have a service
i'm trying to implement a Repository and UnitOfWork patterns using Entity Framework. This is
I have a repository pattern setup using NHibernate. The base class looks like this:
I'm using EF along with mvc, for that I've a generic repository, unitOfWork implementation
I am using Unity with MVC and NHibernate. Unfortunately, our UnitOfWork resides in a
Using Ivy with this Ant target: <target name=retrieve-jars> <ivy:retrieve pattern=WebContent/WEB-INF/lib/[artifact].[ext] /> </target> to fetch
I’m using NHibernate for data access, but accessing it through a façade layer. This
I have a service layer returning a collection of entities : /// <summary> ///
I am currently using TopShelf with Ninject to create a Windows Service. I have

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.