DDD: Where to create entity objects?

Posted by ciscoheat on Stack Overflow See other posts from Stack Overflow or by ciscoheat
Published on 2010-06-08T19:06:54Z Indexed on 2010/06/08 19:12 UTC
Read the original article Hit count: 175

I have three entities that must interact: User, SupportTicketand PhoneConversation. When someone calls in requesting help, the User should have a SupportTicket assigned to him, with a PhoneConversation assigned to the Ticked describing the call.

My question is: In what entity should I put the method CreatePhoneSupportTicket() that creates a new SupportTicket and a PhoneConversation, relates them to each other and finally relates the SupportTicket to the User?

I'm guessing it can't be on the user because that would violate the SRP (the user does a few more things). But the method itself does more than one thing, it should create both a SupportTicket and a PhoneConversation. Is this a situation when a Service is a better solution then putting methods on entities? Thanks for your help!

© Stack Overflow or respective owner

Related posts about ddd

Related posts about domain-driven-design