Which folder should I put strategy objects, or any objects that are not domain models? I’m using Zend Framework, if that matters. Appreciate it!
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Two pretty standard options:
Place this code into the
libraryfolder. Typically a filelibrary/App/SomePackage/SomeClass.phpwouldcontain the classApp_SomePackage_SomeClass. Just add the lineautoloadernamespaces[] = "App_"into yourconfigs/application.inifile.Create a new folder inside your
applicationfolder and configure aZend_Loader_Autoloader_Resource(or its extended classZend_Application_Module_Autoloader) with appropriate appnamespaces, paths, and prefixes.Using this second approach could go something like this:
Then a class named
Application_Strategy_SomeClasswould reside in the fileapplication/strategies/SomeClass.php.Noe that using
Zend_Application_Module_Autoloader– instead of the more generic parentZend_Loader_Autoloader_Resource– will give you a standard set of autoloader mappings for models, forms, services, view helpers, etc.