MVC Architecture

Lahiru Sampath Abegunawardena
2 min readJun 21, 2018

Hi I’m Lahiru Abegunawardena. From this blog I would like to talk about MVC architecture.

As you already know we use programming languages to solve our problems using computers. Programming architecture is a something that helps you to keep your code neat and understandable. Mostly the requirement of using a coding architecture is applicable to any system you design with a database or a one with large set of components. If you clearly works on some architecture that would be an extra advantage to your maintenance periods too. There are a lot of programming architectures that popularly used around the world which are perfectly matching according to programmer’s choose.

MVC is one of mostly used popular programming architecture. A lot of web based applications and some Standalone applications (specially on Java) can be coded using this architecture. There are some programming frameworks which are mainly based on MVC architecture.

Now let’s see deep into the MVC architecture. What does it mean and what are the specific facts that can be seen in this architecture. If you use MVC architecture in your program we can identify clearly 3 sections named as

  1. Model
  2. View
  3. Controller

So now let’s see what are these 3 sections do and their specifications.

  • Controller

This is the section where your web page getting controlled. Loading views, models. Most of the functions are written here. If you want to perform action when button clicked you can write functions through this.

  • View

This is where you can edit your front end. Each and every page you loaded is written in this section.

  • Model

This is mainly used for DB connectivity. If you wan’t you can avoid using this, because connecting with DB and perform CRUD operations also can be done through Controllers. Update, delete, data selection, insertion can be done here.

Let’s see a brief explanation..

Think you are using a website that works in MVC architecture. The front end of home page of website is written in ‘view’ block. But it’s loaded through a function written in ‘controller’ section. Think that you are going to login to system. When you filled login forum (eg- username and password) and clicks ‘login’ button, it activates relevant controller file. It gets data you entered. Calls ‘model’ section and gets relevant data set from DB. Controller checks whether data you entered is matching with data from DB. If it’s matching ‘controller’ calls function it self and creates session, and loads relevant page from ‘view’ section.

So I think this will be a help for you to get a good knowledge on MVC architecture. Please be free to comment your ideas, share for friends and like it. Thank you..!!!

You can contact me via my facebook and linkedin profiles..

--

--