I disagree and without pointing at some references to your comments, I
think stating such opinions is too dramatic.
We have plenty of systems where we use full blown entities as opposed to
DTOs that can persist themselves using an ambient context and have no
problems what so ever and in fact this approach has been a de facto
standard on a lot of our projects.
After reading quite a bit on IoC ( including the book mike mentions) I
wanted to attempt to have the dependencies injected into the entities too
but haven't seen a good example on doing this yet.
Now, this may be because there are good reasons not to do this, but that
was the question. Mike has clearly done some research and stating to just
go and do more isn't very helpful.

On 14 Jan 2013, at 00:33, Sebastien Lambla <[email protected]> wrote:

 Hving dependencies in entities is a worst practice. Stop right now and go
read some more on domain entities and the dependency inversion principle.
Like right now. Run.


 On 11 Jan 2013, at 18:55, Mike <[email protected]> wrote:

Based on some research I've done (Dependency Injection in
.NET<http://www.amazon.com/Dependency-Injection-NET-Mark-Seemann/dp/1935182501>
and
through coding experience) Constructor Injection is often the best way for
an object to receive dependencies. My questions are:

   1. Are others who use NHibernate using Constructor Injection in mapped
   entities?
   2. What is the current best practice for integrating a container such as
   Castle Windsor with NHibernate to enable Constructor Injection for mapped
   entities?
   3. From what I have seen, creating a custom IBytecodeProvider would work
   to enable NHibernate to use an external container. Is there an official
   source for a Castle Windsor IBytecodeProvider that will work with the
   latest version of NHibernate?


 Thanks for your help

 --
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/nhusers/-/aPKySRgCGIMJ.
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.


 --
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.

-- 
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.

Reply via email to