As i have been thinking how to make code maintainable, i thought about modular structure. But as i started to implement it I found this really difficult, as I haven’t found any good articles, guides about this.
Only thing what i found was this blog http://www.atirjavid.com/Zend-Framework-Tutorials/index.html, seems to be really good, but the article hasn’t been finished yet. As i almost got this working as much there is code. Problems come in with model loading. When using model locating in /modules/default/models/DbTable/Users.php then it cant find the model or Zend_Table class.
Last solution what i saw is this, but it makes you say “Isn’t there other way ?”
I think the problem you are having is because the location ‘/modules/default/models/DbTable/Users.php’ is likely not in your php include path.
When I’m setting up a modular structure with the ZF I like to store all my models in a library folder and have the model class names follow the ZF class naming specs. For instance you could have:
library/MyNamespace/Db/Table/Users.php with the folder structure…
Ok this would be one of the solutions, but the advantage of this is the models are “really” separated. So you store the models and tables similar to this structure.
I would think that zend makes things more complicated than they need to be. I haven’t seen large open-source project/product using Zend yet, and if you look around the net, people seem to be having fun and games whenever they try to use zend framework.
I saw some examples from the Magento code based raised in a recent code review tutorial. There were interesting cases where it seemed classes should have descended from ZF classes/interfaces but did not. Not sure how wide spread that was in the code base or how familiar you are with the details of this projects code. http://www.slideshare.net/sebastian_bergmann/php-code-review-1464932 slides 20-49
I’m pretty familiar with the Magento code, and I have a lot of strong opinions about the code itself - most of them negative. I don’t want to share my opinions about it here because I don’t want to get this thread off-track, but I will sum up my opinions here in one statement: needlessly complex.