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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T04:32:42+00:00 2026-06-05T04:32:42+00:00

In my n-tier architecture, I have a mapper layer to fill my responsecontext from

  • 0

In my n-tier architecture, I have a mapper layer to fill my responsecontext from the dataset/datatable comes from DBlayer. So DBlayer calls Mapperlayer to get the things done. But before filling responsecontext i need to do some validation. For this, shall i call businesslayer from mapperlayer? Or i should just pass what i get from DBlayer to businesslayer and ask the businesslayer to call mapperlayer.

Here, My business layer will use Business Entities to do thier own operation. Kindly help me on to sort of this design decision.

  • 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-05T04:32:43+00:00Added an answer on June 5, 2026 at 4:32 am

    Either one will “work”, but I prefer not putting such things in a business object.

    Having the business layer call the mapper layer creates a circular dependency between packages. The mapper layer already has to know about the business layer – that is the heart of its responsibility.

    But why should the business layer know about the mapper? Mapping has nothing to do with business logic. The harm, of course, is that you can never test them independently if there’s a two-way dependency.

    I’d keep it as a one-way dependency. You can test the business objects independent from the mapping objects that way.

    I’d also keep the mapper inside the persistence tier, not situated between persistence and model. Have your persistence layer return business objects, not ResultSets. Let it be package private if possible. My reasoning is the same – minimum knowledge means minimal coupling.

    There are different levels of validation. I’d say that data should have been validated long before it gets into your database. There should be no need to validate, except for specific business rules, when you query the database. Those rules should be part of the business transaction in the service layer, not the persistence layer.

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

Sidebar

Related Questions

I have a two tier architecture based website-data layer and UI layer. I have
We have to implement a two tier architecture to distribute a cache from a
I have a 3-tier architecture system (Data, Logic, Presentation). The Presentation layer is an
I have been trying to find the different between MVC and 3-tier architecture in
I have created my own customized lots of architecture including n-tier layers for different
I am confused about the different possibilities to express a 3-Tier architecture. Data-Access-Layer Business-Layer
Other SO threads have asked people if they prefer N-Tier or MVC architecture. I'm
I have an application based on 3 tier architecture with postgres database(npgsql) having more
I have read some web articles about Three-Tier Architecture. However, I am little bit
I have a website which is utilzing MVC3. I have an n-tier architecture and

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.