On Aug 28, 9:09 pm, Brendan Erwin <[email protected]> wrote:
>
> In doing the research I see a lot of people speaking out against
> having dependencies in ones domain, but the way I see it my data
> access strategies and policies are part of my domain. How wrong am I?
>
Not wrong at all, perhaps. :)
I don't think you'll hear too many cries of "heretic!" for having DAOs
in your domain model, so long as you do it as you've suggested, i.e.
by relying on a DAO interface and injecting the DAO implementation.
Something like this...
public class Customer {
private IOrderDAO orderDao;
public Customer(IOrderDAO orderDao)
{
this.orderDao = orderDao;
}
public int Id { get; set; }
public IList<Order> GetAllOrders()
{
return orderDao.FindAllOrders(this.Id);
}
}
That's my $0.02 anyway.
--Stuart
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---