Should services always return DTOs, or can they also return domain models?

it doesn’t feel right when domain model leaves business layer (service layer) Makes you feel like you are pulling the guts out right? According to Martin Fowler: the Service Layer defines the application’s boundery, it encapsulates the domain. In other words it protects the domain. Sometimes service needs to return data object that wasn’t defined … Read more

Domain Driven Design: Domain Service, Application Service [closed]

Services come in 3 flavours: Domain Services, Application Services, and Infrastructure Services. Domain Services : Encapsulates business logic that doesn’t naturally fit within a domain object, and are NOT typical CRUD operations – those would belong to a Repository. Application Services : Used by external consumers to talk to your system (think Web Services). If … Read more

What is the difference between DAO and Repository patterns?

DAO is an abstraction of data persistence. Repository is an abstraction of a collection of objects. DAO would be considered closer to the database, often table-centric. Repository would be considered closer to the Domain, dealing only in Aggregate Roots. Repository could be implemented using DAO‘s, but you wouldn’t do the opposite. Also, a Repository is … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)