MVC made easy

When I was first learning MVC I don’t have much to any experience programming for the web. I didn’t even now what the request response cycle was. The most programming experience I have ever had was printing interesting patterns using Java.

At the end of the day MVC is much more of an idea about how and why we should structure a program. For example when we write a web site that has your basic CRUD operations, you don’t want everything living in a single file that requires you to use the find functions to find your method.

So start separating out functionality, and at a very basic level we get a Model, View, and Controller. There for each of these things do something very specific. Most applications at a basic level usually involve:

  • Displaying data
  • Working with data
  • Navigation

The MVC design pattern helps you do those things, in a effect organized way. The direct translation would be:

  • Displaying data -> View : Think -> React, Angular, EJS
  • Working with data -> Model : Think -> Plain old classes (ORMs)
  • Navigation -> Controller : Think -> Express.js, Spring, Django

And there you have it, the MVC pattern explained. Now these direct translation might not be true for every framework out there, but for the most part they are true. You can this design pattern applied in almost every app frame work, form Metoer.js to ASP.Net MVC.

Note ORMs aren’t covered in this post, they require their own post to properly explain.

Hope that helped you guys understand.

One thought on “MVC made easy”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s