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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:35:49+00:00 2026-05-26T21:35:49+00:00

If I follow decoupling all the way, it would appear that DataAccess layer should

  • 0

If I follow decoupling all the way, it would appear that DataAccess layer should be de-coupled from models. But then passing the information to the data access layer becomes cumbersome…Instead of:

void Save(myModel modelObject) {
//db.Save here
}

I will do

void Save(string objectprop1,objectprop2...) {
}

Wouldn’t that defeat the purpose of simplicity?

I think that passing a model to my data access layer is perfectly clean code, but then it’s not de-coupled.

  • 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-26T21:35:49+00:00Added an answer on May 26, 2026 at 9:35 pm

    Your data access layer should certainly know about your domain models. You’re right in thinking that breaking them apart into untold numbers of primitive arguments would be a very bad thing.

    De-coupling the DAL doesn’t mean removing the dependency of the models from the DAL, but rather removing the dependency of the DAL from the models. The DAL can be represented, for example, by simple repositories:

    interface Repository<TModel> where TModel : BaseModel
    {
        TModel Get(int id);
        IEnumerable<Tmodel> Get();
        void Delete(int id);
        TModel Save(TModel model);
    }
    

    Or something of that nature, there are many ways to design it. The idea here is that the DAL is then free to store things in a different structure than the models represent. But from the perspective of the models, they’re just persisting to repositories. The actual data persistence may be a different table structure (optimizing the database for performance without having to change the business models as a side-effect, for example) or even in multiple databases entirely.

    There’s nothing wrong with the DAL knowing about the domain models. Indeed, as part of the domain, the DAL is expected to know about it. The models are central, the DAL is a back-end implementation which uses them.

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

Sidebar

Related Questions

Follow Up Question: I noticed with the binaryformatter that all I had to do
Follow up question from Multi-core usage, threads, thread-pools . Are threads moved from one
Follow up from: Directdraw: Rotate video stream I managed to preview the camera's video
In follow up to this question , it appears that some numbers cannot be
General Follow the same standards for all tests. Be clear about what each test
To follow on from my question yesterday.... MySQL Table Design for a Questionnaire I
I follow this rule but some of my colleagues disagree with it and argue
I follow the steps in the customdialog example in the documentation, but I get
I am developing a web app but is not satisfied with is architecture that
Follow up to this question This (similar version from old link) works in SQL

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.