Timeline for Can the Application Service layer create an instance of a non aggregate root?
Current License: CC BY-SA 3.0
7 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Nov 8, 2017 at 6:31 | comment | added | Doc Brown | Yep, you are right, the title talks about creation, but the question text including the example does not. However, I think this is not the gist of the question. | |
| Nov 7, 2017 at 17:59 | comment | added | RibaldEddie | The OP's question needs a bit of clarification but even so, Application Services are not the same as Domain Services and the former should not be holding references to domain entities. | |
| Nov 7, 2017 at 17:10 | history | edited | RibaldEddie | CC BY-SA 3.0 |
added 1446 characters in body
|
| Nov 7, 2017 at 17:02 | comment | added | Doc Brown | Yes, that's correct, but the OP was not asking for object creation within the service. He asked for dealing with Invoices inside the service, independently from Customer objects, so I deduce there will be an InvoiceRepo and/or InvoiceFactory as well. | |
| Nov 7, 2017 at 16:55 | comment | added | RibaldEddie | @DocBrown To be clear, I think Evans identifies, in the domain, just a few types of objects: Value Objects, Entities, and Services. It's true that within the Domain Service, which is NOT the same as an Infrastructure Service or an Application Service, references to domain objects are held, but it's pretty clear that object creation of something like an Invoice would belong to a Factory, not to the Service. | |
| Nov 7, 2017 at 16:33 | comment | added | Doc Brown | "Evans makes clear that classes that are not aggregate roots cannot be retrieved from any place other than through an aggregate root". I don't think so. IMHO Evans makes clear that classes that are components cannot be retrieved from any other place. But simple domain objects that are no aggregates are not necessarily components. | |
| Nov 7, 2017 at 16:17 | history | answered | RibaldEddie | CC BY-SA 3.0 |