That is what I wanted to say in my comment:
If an entity has an external dependency, that dependency should be
injected in its repository rather than in the entity itself. Most
DDD-Patterns make also sense in a pure data-driven design.

2009/1/6 hammett <[email protected]>:
>
> That really doesnt make it. Entities dont belong on ioc container.
> When you create such dependency you'll need to have factories (or as
> you suggest, repository) everywhere you need a new entity instance.
> The viral nature of this dependency leads to incredible headaches, if
> you - like myself - dont want to rely on hacks or statics.
>
> But I guess this is something that ppl should feel in their bones.
> Writing about it wont cut it.
>
>
> On Mon, Jan 5, 2009 at 11:40 PM, Markus Zywitza
> <[email protected]> wrote:
>>
>> Agreed, handling that in a nice RepositoryImpl is way cleaner and
>> instantly understandable.
>>
>> -Markus
>>
>> 2009/1/6 hammett <[email protected]>:
>>>
>>> IMHO he has no idea how that can be troublesome.
>>>
>>> On Mon, Jan 5, 2009 at 7:11 PM, Michele Cantelli <[email protected]> 
>>> wrote:
>>>> Any news about?
>>>>
>>>> I'm stressing about this because I found an interesting feature in NH2.1
>>>> about Entities and Dependency Injection which I found quite useful in many
>>>> scenarios. You can read more
>>>> here: 
>>>> http://nhforge.org/blogs/nhibernate/archive/2008/12/12/entities-behavior-injection.aspx
>>>> >
>>>>
>>>
>>>
>>>
>>> --
>>> Cheers,
>>> hammett
>>> http://hammett.castleproject.org/
>>>
>>> >
>>>
>>
>> >
>>
>
>
>
> --
> Cheers,
> hammett
> http://hammett.castleproject.org/
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Castle Project Development List" 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/castle-project-devel?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to