On 21-Apr-09, at 07:02 , manuel aldana wrote:
Christian Edward Gruber wrote:
On 20-Apr-09, at 19:39 , Thiago H. de Paula Figueiredo wrote:

Now I get it. Thanks Christian!
All you said, to me, is one more reason to not inject services in domain objects . . . :)


Yeah - that's such an anti-pattern. If you're injecting things into value objects, you've probably not separated concerns well.

OK, some motivation to my approach:

Looking to DomainDrivenDesign I am putting behaviour to the domain- objects. Internally I base this behaviour on interfaces, so I decouple things.

Because I use dependency injection for my domain-object, why shouldn't I use a dependency injection container like tapestry-ioc then? I try to avoid coding these annoying factories myself.


Ok, I think there are two different kinds of logic here - pure business logic, and plumbing. I don't think people are opposed to putting pure domain logic or business logic into domain objects - but these aren't things that would usually need factories. What you shouldn't be putting into domain objects is plumbing, so to speak. So maybe you're just wrapping up domain logic into components and injecting them - I guess that's all-right, but I typically don't see that sort of logic as separate from the domain objects, and wouldn't probably make inject-able components out of it in the first place. But anyway, as Thiago said, we should take this off-list, since it isn't a general architecture discussion list.

Christian Edward Gruber
e-mail: christianedwardgru...@gmail.com
weblog: http://www.geekinasuit.com/


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to