I would like to start working with Zend Framework 2
and need some guidance regarding the architecture of the framework. I compared the Akrabat ZF2 tutorial with it the equivalent of ZF1 and the main difference that I have noticed so far seems to be using modules . I like the idea of ββmodules as independent and reusable code snippets, and I think this could help segment your application and make it more convenient. For example, I could have the following mapping URL => module
:
http://example.org/products => Products module http://example.org/services => Services module http://example.org/oauth => Oauth module [...]
What I'm confused about, some of my modules will use the same basic database resources (for example, both Products
and Services
use the same table for comments) and, therefore, the same database models. Accordingly, I am wondering:
Where should I put my database models when they are used by several modules?
source share