http://code.google.com/p/codebettercanvas/source/browse/#svn/trunk
I think the answer from the DDD perspective is whatever makes sense in your domain.
I personally would create an IAuthenticateUsers interface and allow my controller to depend on that. Create a simple Authentication mechanism that meets the current need. As the authentication & authorization story unfolds though out your iterations add complexity as needed.
On Mon, Jul 13, 2009 at 8:18 AM, chevronboyde <samuel@...> wrote:
Hi All
DDD Noob here needing some clarity on DDD. I am looking at an asp.net mvc web application and have a few questions.
1) Where would actions like AuthenticateUser(username, password) exist?
Does this exist as a method of the User entity i.e. User.Authenticate(username, password)
Should it exist as a service to the Domain UserService.AuthenticateUser(username, password)
2) When persisting entities, should I be using a service/facade or using the Repository directly:
User user = new User("Joe Soap");
IoC.Container.Resolve<IUserRepository>().SaveUser(user);
or something like UserFacade.SaveUser(user) which in turn uses the repository.
Previously my tiers were as follows:
Web - asp.net
BusinessLogic - facade and business objects with methods like SaveUser
DataAccess - encapsulated data access using ent library
Common - config info, services etc
I am trying to understand how this translates with DDD with a simple example of authenticating a user and saving a user to the db. Curently using nhibernate, castle windsor and rhino
Hope that was clear
Sam
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/altdotnet/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/altdotnet/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:altdotnet-digest@yahoogroups.com
mailto:altdotnet-fullfeatured@yahoogroups.com
<*> To unsubscribe from this group, send an email to:
altdotnet-unsubscribe@yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
--
"The explanation requiring the fewest assumptions is most likely to be correct."
- Occam’s Razor
http://en.wikipedia.org/wiki/Occam's_Razor