3 ms·
What you're seeing is actually correct. In MVC, the data and logic reside in the Model, with the Controller only handling communication between the other compon
by Geckoman 16y ago
What you're seeing is actually correct. In MVC, the data and logic reside in the Model, with the Controller only handling communication between the other components.
Don't make the mistake of equating the Model with your Data Layer. They're obviously related, but not equivalent.
There are some variations on MVC where the distribution of responsibilities is different.
- tudorizer 16y ago"some variations on MVC where the distribution of responsibilities is different" Most don't. I'm using Django. Recently I've started digging into iOS development (whichs rocks). I know that comparisons between the two are not fair, but I can't help wondering. As I want to have my code easy to read and maintain, I'm trying to find the best places to put the methods, so they make sense. Any other tips are welcome.
- Geckoman 16y agoYes, I should clarify. I don't think any of the MVC-variants encourage business logic to be in the controller. The differences are really in the view and controller layers. I suppose, strictly speaking, the others -- MVP, MVVM, MVT, etc -- aren't properly called variants of MVC, but they're all aiming for philosophically similar divisions of responsibility.