Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
318 views
in Technique[技术] by (71.8m points)

model view controller - What is the best definition of MVC?

I have been using the Zend Framework with an MVC configuration, read about Ruby on Rails and I plan to explore other MVC frameworks in Python (Django?). I really like the way it isolates some parts of the logic, security, and validation. But after just one year of using it I read an answer here saying that almost everyone has a wrong definition of MVC and that made me wonder: What is the Right definition of MVC and where could I read about the pattern and standard implementations?

Update: I understand we all know the BASIC definition (there's a model a controller and a view, the actions on the controller go to the view with some info after making something with the model) but I would love to know what is the definition you THINK everyone KNOWS and why is it wrong (and maybe that will explain to everyone where there could be mistakes, opinions, and of course what is your real point of view of this)

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The most major mistake I find with peoples understanding of MVC is that they think the pattern encompasses more than it does. More specifically people often think:

  • Model = DataBase
  • View = HTML
  • Controller = Business Logic and everything else.

This is often the way things work in a smaller application but reality MVC is a way to seperate the Business code from the presentation code. The Model does all the real business work. The views provide the look and feel, and the controller maps one to the other.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...