I have some questions about the structure of ZF modules and models.
(I'm talking about ZF 2, because I gave up of ZF 1.11)
To make my question simple to understand, look at the following example: (I create this just to learn ZF2)
It's a "movie manager application". In this application I have 3 kind of users:
- visitors: peolple who olny can see the movies in the database.
- members: same as visitors plus insert, update and delete movies.
- administrator: same as members plus insert, update and delete users and other informations as genre, artist, ...
members can't insert nothing more than a new movie, i. e., they can't insert a new genre, neither a new artist.
ok... for this problem, I found this solution:
- create 3 modules: visitor, member, admin;
but I'm not sure if it's the best way of organize de program...
I realize that ZF expects people organize application this way:
- create modules for each funcionallity;
- create roles for each kind of user;
so, my questions are:
1. My solution is right or wrong?
2. If my solution is right, how can I organize my application?
3. How can I organize my models, to be visible to more than one module?
- I think a should create a model "movie" somewhere if "inserts, updates, deletes, and selects"
then a module "visitor" could only use a "select" while a module "member" could use all the funcionallities. Am I right?
4. If my solution is not right, how can I organize my application?
5. How should be my modules?
I really stuck with this problem. A couldn't find answers anywhere... If someone have a little application like this one and you don't mind to share, I'll be glad.
if I'm not clear at my questions, please ask!
Thank you for your help.