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.
This is AJAX based on asmx script service. Should I have:
- 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
- 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.