Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > Other ASP.NET > BOOK: Professional ASP.NET Design Patterns
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
BOOK: Professional ASP.NET Design Patterns
This is the forum to discuss the Wrox book Professional ASP.NET Design Patterns by Scott Millett; ISBN: 978-0-470-29278-5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional ASP.NET Design Patterns section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 22nd, 2012, 04:31 PM
Registered User
Points: 5, Level: 1
Points: 5, Level: 1 Points: 5, Level: 1 Points: 5, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Trying to understand DTO justification

First off, awesome book. I've been waiting for a book like this to come along for a very long time.

While I was showing the "Millett Stack" to a coworker the other day I was asked about the justification for the DTOs and not letting the model bleed up to the UI. I couldn't remember why you did this so I went back to your book to look it up and couldn't find the justification. I think perhaps it's just so the UI layer is only dependent on the Service layer? Just kind of want to hear the formal explanation from the man himself. If you'd prefer to reference the book I'm fine with that as well. BTW, We're actually using EF code first (clean POCO) with EF layer separated in the repository layer within the stack.

Thanks for again for a great book!

Last edited by ludwigs3rd; February 22nd, 2012 at 04:34 PM..
Reply With Quote
  #2 (permalink)  
Old February 25th, 2012, 06:03 AM
elbandit's Avatar
Wrox Author
Points: 599, Level: 8
Points: 599, Level: 8 Points: 599, Level: 8 Points: 599, Level: 8
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2007
Location: Southsea, Portsmouth, Hampshire, United Kingdom.
Posts: 107
Thanks: 10
Thanked 17 Times in 15 Posts
Default

Hi ludwigs3rd,

Thanks for reading the book!

I cover ViewModels on page 349. Sometimes the UI needs to show a summary of different parts of the domain model. Passing back a full model for the UI would be too clunky, better to have a ViewModel specific to the view. If however you have a nice one to one mapping between the UI and the entity then you can just return the model. Does that answer your question?

I prefer now to follow the CQRS pattern and have a query service separate from my domain model to provide the ViewModels/Dtos for my views. This enables my domain model to only be concerned with enforcing business rules and not how it's displayed. This is something I will cover in my new book. I am on iPad at mo but will knock up a quick diagram when I'm home to show you what I mean.

Let me know if you want any more info or if you have any questions.

Cheers
Scott
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 5: justification.php DTackett BOOK: Beginning PHP 5.3 0 October 7th, 2010 10:48 PM
Please help me understand SeanDunn BOOK: Beginning Microsoft Visual C# 2008 ISBN: 978-0-470-19135-4 3 November 14th, 2009 02:38 PM
I don't understand... jmsherry ASP.NET 2.0 Basics 17 July 23rd, 2007 12:28 PM
Full Justification through Text Box in VB2005/VB6 saurabh_diwan Visual Studio 2005 1 April 2nd, 2007 08:36 AM
I still do not understand aude_poullain ASP.NET 1.0 and 1.1 Basics 2 February 7th, 2007 09:11 PM



All times are GMT -4. The time now is 07:40 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.