I usually put these sort of things into my service layer, so I have a
services folder like I have a models folder and load them in the same
way as my models. So you could have something like directoryService
that encapsulates all your directory access behavior.

If you read Domain Driven Design, it defines services as things that
do not logically fit into the domain model. I also use services to
provide model access across modules this way I can use a service
locator that can tell me if the service is available or not.

2009/1/6 Guillaume BABIK <guilla...@internim.com>:
> Hi,
>
>
>
> I've got a script which generate a group of directories from a name file
>
> Ex: 12345678.jpg => /1234/5678/
>
>
>
> This script can be called from many places in my ZF application
>
>
>
> I am looking for the best practice to implement this script in my ZF
> application.
>
>
>
> Lots of possibilities:
>
> -         Case I : In a Model file: But my script is not associated to a
> single model.
>
> -         Case II : In a static method in a class like My_Function_Library
> (In order to be simply called by Zend_Loader)
>
> -         Case III : In a simply PHP file which I includes in my Bootstrap
>
> -         => Other ideas???
>
>
>
> Currently I put theses sort of scripts in statics methods in a class (Case
> II)
>
>
>
> But is this the Best Practice?
>
>
>
> Many thanks,
>
>
>
> Cheers,
>
>
>
> PS: HAPPY NEW YEAR!!!!
>
>
>
> Guillaume BABIK
>
> INTERNIM
>
> 45, rue Aristide Briand
>
> 92300 LEVALLOIS
>
> Tel : 01.40.87.11.20
>
> Fax : 01.47.57.38.87
>
> Mobile : 06.80.21.90.29
>
> http://www.internim.com
>
>



-- 
----------------------------------------------------------------------
[MuTe]
----------------------------------------------------------------------

Reply via email to