4 ms·
This is exactly why Django used to call itself an "MTV" framework (Models, Templates, Views) rather than an "MVC" framework - we realised that the classic MVC p
by simonw 15y ago
This is exactly why Django used to call itself an "MTV" framework (Models, Templates, Views) rather than an "MVC" framework - we realised that the classic MVC pattern didn't really apply to the Web.
We lost that argument because no one cared - in fact, I think we probably caused a whole load of confusion by not using the same terminology as all of the other frameworks.
- andrzejkrzywda 15y agoI'm a Rails person, but I always respected the Django community. The fact, that you were clear with the MVC vs MTV approach since the beginning was one of the reasons.
- TheSmoke 15y agopyramid is also following you there however you are right on causing confusion.
- DasIch 15y agoAre there any notable Python Frameworks that don't use MTV?
- est 15y agoTFA > In short, we're talking about MVC when a model can notify (through the Observer pattern) the views about the changes. It's not possible in a classical Rails app (it's possible when you use WebSockets, Pusher or a similar technology, but it's not so popular yet.). MVC was popular in desktop apps. MTV isn't really Web nature. You change the database schema, and the browser client automatically refreshes? I don't think it's really useful. An ad-hoc solution would be better.
- olavk 15y agoI have never fully grokked the architecture of web "MVC" frameworks. I now realize it was because of confusing naming. For people who are familiar with the MVC pattern for desktop UI's, I think it is confusing to use the same name for web frameworks which follow a different architecture. On the other hand, for people without this background, for whom MVC means "like rails", it is probably more confusing to introduce a new name for the same.
- the_mitsuhiko 15y ago> We lost that argument because no one cared I think the Python community in general adopted that Concept though. The term "view function" is much more common than "controller method". Flask at one point even had the term MTV in the docs I think but we just got rid of it and no longer mention any design patterns there. It's just too much confusion. Often enough people jump into the IRC channel and ask how to use "MVC" with Flask and what their question really boils down to is how to use a class instead of a function. Design patterns are good and well, but I think documentation should encourage more thinking outside the box.
- zzzeek 15y ago> encourage more thinking outside the box. think outside the box ? how about...."controller function" ! There now I've blown your mind. Who says controllers have to be classes ? Again in GOF days, it was all smalltalk/C++, everything was a class. Not the case with what we use today. A "module of functions" is not terribly different.
- the_mitsuhiko 15y agoYou are preaching to the choir. :-)