To make my doubt clear, I have this scenario:
I have an app that sells cars and houses (just an example!), so I created a module to show all the cars, called Cars, and one to show all the houses, called Houses.
I have a Manager module that should have a CRUD system for Cars and Houses.
Where should I put my models for cars and houses? I should create a module just to put my models, like a Main
module? Or I should put my models in Cars and Houses modules and access them in Manager module?
Let's say I create a CarModel
with the methods select, insert and delete. If I put this model in Cars
module I can have a security problem because Cars
now have access to insert and delete methods...
On the other hand, I could create a CarModel
inside Cars
module with only the select method and then create again a CarModel
with insert and delete in Manager
module, but It will make very difficult to maintenance of the code...
What's the best way to solve this issue?