Home > General, Programming > What is MVC Architecture? (Model – View – Controller)

What is MVC Architecture? (Model – View – Controller)

MVC Architecture has implemented by Trygve Reenskaug at 1979 for the first time. It was implemented on Smalltalk at Xerox labs. Then benefits and advantages of this architecture has been accepted by most of the coders and software engineers.

It was an information about MVC’s history above. Now lets talk about what really MVC is. What do you understand from MVC. The word M stands for Model, V stands for View and C stands for Controller. I am going to mention about each item.

The figure above may help you while thinking what structure it might have. Let’s start with Model.

Model:
It handles data processing and database works part. Model processes events sent by controller. After processing these events then it sends processed data to controller (thus, controller may reprocess it) or directly to view side.

View:
View prepares an interface to show to the user. Controller or model tells view what to show to the user. Also view handles requests from user and informs controller.

Controller:
Let’s say controller is like brain of the system. That is right. Because it processes every request, prepares other parts of the system like model and view. Then the system determines what to do by controller’s commands.

Even if you are junior developer you probably faced with a problem called “Complexity of Project”. There MVC comes. MVC helps you to decrease complexity of project. For instance, there is a team with 5 people. If they are working on same project after sometime project reaches a point which no one cannot understand what is project going to be. What i mean is MVC splits project to (by default) three different parts. Like Model, View, Controller.You can say;

As you see above if you split your project three part like Application Development, Database and Data processing and Interface development then of course you project will be more understandable and developers can work more efficiently.

What are the advantages of MVC?
MVC is perfect for team work. As i mention before this architecture splits your project into some parts so, team members can work and their parts without any dependency. Then you will realize that MVC makes your project more systematic.
It is really easy to edit or change some part of your project that makes less development cost and maintenance cost.
MVC doesn’t repeats itself. If you wrote some script for your project. Because of non-dependancy property of MVC then you may use this script for another project of yours. And of course it helps you to finish your project by spending less time then others.
And developers doesn’t fight after 5pm :)

Why MVC is non-standard?
Still waits for developers to discover itself. :) I know some developers who think that they have to write even every semicolon, letter. you don’t have to do that. However, MVC tries to help you to don’t repeat yourself.

Why MVC is too important for Companies?

Well it is not!. Yes that is true. A company only looks for if a project is done on time or not. Most of the companies doesn’t interested what structure you are using while developing.
Probably you know this formula : P=W/T  (P:Power – W:Work – T:Time) As you see here if you descrease the time so you may done with more Work. That means money! So, you see how MVC helps you.

Example:
As an example you can think like eyes of a human stands for view, brain stands for controller and neutral system of a body stands for model. You can imagine like when a person sees his friend eyes (view) tells this to the brain (controller). Brain wants to show smile to his friend. To make it possible brain tells your face’s neutral network that make the face smile. Then his face smiles :) Hope it helped.

VN:F [1.9.11_1134]
Rating: 9.1/10 (22 votes cast)
VN:F [1.9.11_1134]
Rating: +1 (from 1 vote)
What is MVC Architecture? (Model - View - Controller), 9.1 out of 10 based on 22 ratings
Categories: General, Programming Tags: , , ,
  1. Kate
    July 27th, 2009 at 11:50 | #1

    Good article ;) thanx

    VA:F [1.9.11_1134]
    Rating: 5.0/5 (1 vote cast)
    VA:F [1.9.11_1134]
    Rating: +1 (from 1 vote)
  2. August 14th, 2009 at 00:24 | #2

    these was really helpfull

    thanx.

    VA:F [1.9.11_1134]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.11_1134]
    Rating: 0 (from 0 votes)
  3. Avijit
    November 1st, 2009 at 19:04 | #3

    Really a nice article…
    Thanks friend.

    VA:F [1.9.11_1134]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.11_1134]
    Rating: 0 (from 0 votes)
  4. Mubarish
    November 3rd, 2009 at 14:13 | #4

    Very helpful article,

    Thanks a lot for the clear explanation.

    VA:F [1.9.11_1134]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.11_1134]
    Rating: 0 (from 0 votes)
  5. May 31st, 2010 at 16:35 | #5

    Thanks for this article its very helpful for all programmer’s.

    VA:F [1.9.11_1134]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.11_1134]
    Rating: 0 (from 0 votes)
  6. Shivam
    January 5th, 2011 at 11:44 | #6

    i like an example most

    VA:F [1.9.11_1134]
    Rating: 5.0/5 (1 vote cast)
    VA:F [1.9.11_1134]
    Rating: 0 (from 0 votes)
  7. meenakshi
    August 2nd, 2011 at 06:15 | #7

    very nice and helpful article

    Thanks

    VA:F [1.9.11_1134]
    Rating: 5.0/5 (1 vote cast)
    VA:F [1.9.11_1134]
    Rating: 0 (from 0 votes)
  1. No trackbacks yet.