I have the Admin module at my application and within in I have for now two another modules. Each of them have bunch of models ( Article module has 5 models and Shop module has 10 models ). Now all these models placing at protected/models folder, so it looks pretty redundant. By the way, the module main principle is corrupted, because the modules become not portable as I have all the models separated at another directory.
I find out the most methods I use in model classes at admin panel I dont using at the site itself. I mean dozens of filters, validators etc. So should I really separate 'em at protected/models folder or I should place 'em at proper protected/modules/admin/modules/article/models and protected/modules/admin/modules/shop/models folders ?
I worry because I imagine if I have for example 10 modules then it might be 50 models at one folder.
Current application I am working on has 46 database tables (and growing), thus I have as many models in /protected/models/ I don’t see a problem at all with this.
I am also running an admin module, with its own controllers within the module directory, however I have decided to not have models here also. The question for me is: “Portable to where?”. For me running a module is for the convenience of keeping the controllers separate. I don’t mind at all if my models contain code used by the admin. At least it saves on a whole bunch of repetition (DRY). There are many things used by both back and front end.
Nobody can turn around and say "Oh! You are doing it wrong!"
Following from a module oriented perspective all models should be inside a module that responsible for a required functionality. That way you wouldn’t have to worry about number of models. Also, separation between frontend/backend could be performed inside a module, so finally you’ll have all needed functionality (e.g. articles) in one place.
You can use module models anywhere you need, so a solution for your example would be to have only one model People inside module Users. It gives clear understanding which module is responsible for which functionality.
From your point:
If it’s only a one reason for using modules, why you just don’t have sub directories in your main controllers directory?