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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T16:27:03+00:00 2026-06-07T16:27:03+00:00

Suppose you have a layered project divided into the Presentation Layer, the Business Layer

  • 0

Suppose you have a layered project divided into the Presentation Layer, the Business Layer and the Data Access Layer. If you were using CQRS, you would be doing queries directly from the Data Access Layer into the Presentation Layer and bypassing the Business Layer.

In that case, if you are using ViewModels in your presentation layer, then your Data Access Layer would need reference to the Presentation Layer to return data in terms of the ViewModels in the presentation layer. Wouldn’t that be anti-pattern ?

A similar question exists here – Models, ViewModels, DTOs in MVC 3 application

But if you are doing CQRS you will not be mapping between your ViewModel and Domain object as mentioned in the answer, since you are bypassing your Domain/Business layer Then where should you place your ViewModels ?

  • 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-07T16:27:04+00:00Added an answer on June 7, 2026 at 4:27 pm

    As far as i understand CQRS you will get DTOs (DataTransferObjects) from the query side (aka. DataAccessLayer) that gets passed to the UI (PresentationLayer).

    Theses DTO can directly be used as ViewModels for Views, if they provide all necessary data for the View, or can be aggregated with other DTOs in an ViewModel. I think it depends on the data that is presented in the View.

    To answer your question: ViewModels are part of the PresentationLayer.

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

Sidebar

Related Questions

In a layered architecture, you have a presentation layer, logic layer and data layer.
Suppose we have the following table data: ID parent stage submitted 1 1 1
The following definition from wikipedia explains what is the Data Access Layer in a
Suppose we have the following: data Foo x from_list :: [x] -> Foo x
Suppose I have a data frame, df, that looks like: f t1 t2 t3
Suppose I have logged into an application which is running from IIS . Now
Suppose I have the following data: var arr = [], arr1 = [], arr2
Suppose I have: public class foobar { public int lorem; public int ipsum; }
Suppose I have an IEnumerable such as a List(TValue) and I want to keep
Suppose I have string Name and Image Photo as properties of a class in

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.