3

Click here to load reader

Understanding the basic need of MVC architecture

Embed Size (px)

DESCRIPTION

Understanding the basic need of MVC architecture by anil labs

Citation preview

Page 1: Understanding the basic need of MVC architecture

anil2u.info

Understanding the basic need of MVC architecture | Anil Labs

http://www.anil2u.info/2011/11/understanding-the-basic-need-of-mvc-architecture/

Understanding the basic need of MVC architectureHome » Articles, General Category »

November 18, 2011

In this post i would like to explain about basic need of MVC architecture while develop the complexapplications. What is MVC is explained in my earlier post. I will explain this approach with smallexample.

Target : Identify the Red ball in the box from the three balls (red, green and white )

Case 1:

In this case all balls are in the one box. Identify the all red balls is very difficult. Here we can find it inthe first pick or we have to check the all balls in the box. It is very time consuming. And not easy toidentify.

Case 2:

In this case we havetwo boxes. First boxcontains red andwhite balls. Secondbox contains greenbals.Compare to firstcase it is easy toidentify. But there isconfuse in identify thetarget in first box.Here also we tospend less timecompare to first casebut spend time toidentify. We can find itfirst pick or check all balls in the box. Here identify the red balls from two balls so it very toidentifying.

Case 3:

Page 2: Understanding the basic need of MVC architecture

Understanding the basic need of MVC architecture | Anil Labs

Understanding the basic need of MVC architecture | Anil Labs

Case 3:

In this case we havethree boxes. First boxcontanins red balls,second one is whiteballs and third one isgreen balls. It is veryeasy to identify thered balls in this case.With very less timecompare to abovetwo case we canidentify. There is noconfuse whilechoosing or identify the red balls.

Now i am applying these cases to PHP development phases.

Case 1 : Here we develop the application with combaining the HTML , PHP code alongwith the Database in a single page.

If we face the bug and we know there is bug in Database, then also we need to check all code toidentify that bug in this case. We can identify the bug in starting of code then we feel happy. If wedidn’t find that one in the starting of the code then we need to check entaire code. Generally if wecombine all code that means we need to check in plenty lines of code.

Example :

Core PHP applications ( Combination of PHP, Database and HTML )

Case 2 : Here we develop the applicaion with differenciate the HTML from combination ofPHP and Database.

If we face the issue with database then directly go and check in coding part and find the relevent lineof code and rectify it. In this we need to check the all coding part. To check the bug took less timecompare with the case1. But it also took time.

Example :

Smarty ( Template engine ) – Combination of Coding and Datbase in one part and HTML is in

Page 3: Understanding the basic need of MVC architecture

Smarty ( Template engine ) – Combination of Coding and Datbase in one part and HTML is inanother part.

Case 3 : Here we develop the application with differnciate the HTML , PHP and Database.

If we know the bug in database then directly go to the database files and rectify it. It is very easy toidentify and rectify it. Easy to understand.

Example :

CakePHP , CodeIgniter

Related Posts