Stupid Question 199: Do we need to decouple the view from logic (mv* patterns)?
I’m still in London and met up with the brilliant developer Rob Ashton today and his friend Vicky (also a dev) for dinner and drinks with Daniel and Niclas (IT-pros). As always it didn’t take long before we started talking code, and we started talking about MV-something patterns. You know, MVP, MVC and MVVM. The last two are patterns I always use in one way or another, and to be honest I have used them because I feel convinced that the decoupling from the view is desirable. That’s what I’ve always heard. But is it? Does it make sense, always? Is it given that it is the way you should build your application?
Do we need to decouple the view from logic (mv* patterns)?
We did discussed this for at least an hour, and we discussed the idea of having a modularized application with bits that push to a piece if view (the view consisting of several bits) instead of the view pulling data from the view model. So instead of a layered application you would have a modularized application. What would be best and under which circumstances? Are the MV* patterns being overused as many developers overlook options convinced that this is the only way to go? While I still feel convinced, I still want to ask for your opinion.
I have come across situations where the view has to be, or at least seems to be, so dependent on the logic that a separation adds unnecessary complexity which might make the logic somehow loose its context. I’ve still forced in a separation, but now I’m questioning it. Do we need to separate the view from the logic? Always?
Please feel free to share articles, blog posts and comments, and I’ll do my best to sum it up.
Last modified on 2013-06-22