views:

164

answers:

1

Hello,

I'm a using a layered architecture with Zend Framework.

I have MVC with :

Controllers > (DTOs) Services (Service Layer) > (DOs) Repositories > Persistance

Now i have to handle image galleries. The upload process is handle by the front, but what part is responsible for the thumbs generation ?

Do i have to store pictures to a temp folder from the front, passing the temp path to a service which will handle resizing and will move the file to the storage server folder ?

Or do i have to handle the pictures resizing/storage process from the front and pass only the picture URL to the service ?

The purpose of the Service Layer is to move application logic and keep the controllers thin. But for those cases i really don't know who is responsible of what :)

Have you any advices ?

Thanks a lot, Benjamin.

+2  A: 

What do you mean by "for those cases" ? If your strategy is to put all logic in the service layer, then I can't find a reason why you should hesitate...

To generate thumbs is by no mean a "special" process, so it should be in a dedicated service, as usual. The incidental detail about how images are stored as temp files by the front layer should not change that.

The front knows how to upload data, that's fine and that's it; the image-processing services may then take the lead and generate whatever thumbs are needed.

hth

Vincent