zend framework - Using Doctrine 2 and Repositories, what would be the purpose of a Service Layer? -


i'm designing application, , i'm using doctrine 2 , zend framework.

currently, i've wrote entities, going start write repositories, , though services, , i'm wondering if service layer wouldn't repeat repositories.

is worth write service layer while i'm using doctrine 2 repositories?

however, read here , there service layer used caching example.

have implementation example?

the difference between repositories , services let services accept arrays of data updated, creating etc. iirc, true repository should deal domain objects. thing can do, example, use service layer handle generation of thumbnails products, profile pictures, or caching, etc. point services aren't strictly related dealing doctrine entities.

i still use custom repositories container custom queries , not; consumed in service classes , directly in controllers. though use services serialising (for json responses).

there still small grey area should , kinda have feel out. @ end of day: if leave out there service layer , put logic repositories still wouldn't more work maintenance , scalability, less definition in class responsibility.


Comments