MVC concept in Web Development

MVC concept in Web Development

In case web development, we often hear about MVC. What is MVC? That abbreviation of Model – View – Controller concept. Smalltalk Programmer Trygve Reenskaug created this concept in 1979, long time ago before internet booming era. The program architecture significantly different than procedural programming. Many people said MVC have advantage make program more efficient and secure.

let’s take a look inside a MVC Architecture, which basically consist of three main part ( in separate folder ) and connected each other :

mvc works

      1. VIEW

This is place where the web part visible to user, view attached to model where required to get some data update. You can set up style , color and size by include css in this part.

View example :

Class View

{

private $ymodel;

private $xcontroller;

public function _construct(Controller $xcontrol, Model $ymodel)

}

$this->controller = $xcontroller;

$this->model = $ymodels;

}

public function display()

{

return ‘<i><b>’.$this->model->text.'</b></i>';

}

}

      1. CONTROLLER

That is handle event from view, but this is not media between view and model. Although receive user’s input and send commands to model for update data, view get their own data from model.

Controller example:

class Controller

{

private $zmodel;

public function _construct(Model $zmodel)

{

$this->model=$zmodel;

}

}

 

model view controller

      1. MODEL

This most complex part of MVC, store data which required by view. in other word, you can call it skeleton of program. The HTML or other main data like text you can put here

Model Example :

class Model

{

public $word;

public function _construct()

{

$this->word = ‘ Hello world';

}

}

and finally

$model = new Model();

$controller = new Controller($zmodel);

$view = new View($xcontroller, $ymodel);

echo $view->output();

laravel symfony code igniter

MVC implementation not only in php, but in other language like java, ASP or other. Especially for web development, this concept used by all frameworks like codeigniter, laravel, zend framework, symphony.

Share this post
Share on FacebookShare on Google+Tweet about this on TwitterPin on PinterestShare on Tumblr

2 thoughts on “MVC concept in Web Development

  1. The eye-catching and unique websites enable you to stand out from your competition. Web development is not an easy task, you must identify important features that are necessary when creating a website such as entities, anchor tags and others. Thank you for the concept in your page.

Leave a Reply to Gretchen Gasper Cancel reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>