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 November 5th, 2010, 06:13 PM
Authorized User
 
Join Date: Jan 2006
Location: , , Canada.
Posts: 13
Thanks: 6
Thanked 1 Time in 1 Post
Default very simple service that returns a list of names... ?

Hi,

I am designing a web app which has a combobox (textbox + drop down), much like the Google toolbar where a list of suggestions will show after typing a few characters.

The combobox is meant to suggest member names after a few characters are entered.

Question:

This is AJAX based on asmx script service. Should I have:
  1. the Service call the Repository which returns a list of User objects (an Entity with a lot of properties and methods), and then return just an array of names (as DTO) back to the web page?, OR
  2. the service call an ad hoc DAL method that returns just a list of names "List (of String)" without involving the Domain Model and any DTO?
Is #2 acceptable in domain driven design? Or should I design some kind of value object around the User entity which contains only Username & Email & First/Last Name (just an example), and work with a Repository for the value object (doesn't sound right to me though... seems like a DTO)?

#1 to me seems just too heavy for this simple operation.

Thanks! I am new to this domain model (used to Transaction Script) so please bear with me.. if this sounds stupid.
Reply With Quote
  #2 (permalink)  
Old November 5th, 2010, 07:09 PM
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 Samvan,

I think option two is definately the way to go. Have a look at a popular domain driven design method called Command-Query Responsibility Segregation, it splits all actions down into either a query or a command e,g. Do this or give me this information.The query operations simply return view models (DTOs) straight from the data store.

I also regularly include a readonly reporting or presentation repository that returns simple DTO view models of the domain for senarios like this which I use this directly from the UI. This is much more effective for displaying purposes espically as I am not running any business logic.

Cheers
Scott
Reply With Quote
The Following User Says Thank You to elbandit For This Useful Post:
samvan (November 5th, 2010)
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
binding service to an activity, simple example? dan77062 BOOK: Professional Android 2 Application Development 0 October 8th, 2010 10:48 PM
VB Net Ms Access list column names (how to sample) jhkraft VB Databases Basics 2 March 13th, 2008 03:27 PM
Service returns xmlNode instead of xmlDocument! KC7ZDM .NET Web Services 0 February 18th, 2005 08:18 PM
Simple HTTP POST .Net web service? DaveCollinsPenchant .NET Web Services 1 September 10th, 2004 04:46 PM
Creating a simple .Net service badgolfer VS.NET 2002/2003 0 March 31st, 2004 04:29 AM



All times are GMT -4. The time now is 10:44 AM.


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