PHP Tutorial: The Problem with MVC (it's time to move on!)

preview_player
Показать описание
This video will not have any coding but just a short discussion about MVC. As I'm sure you know, MVC has been the dominant programming architecture of not just the PHP community but the entire web development community for the best part of about fifteen years.

MVC's popularity came about because it was the architecture of choice by the genius Next team who worked for Steve Jobs by in the 90s. Had I been a part of that team at that time then I would have applauded MVC. It was a great choice and perhaps even a perfect choice at that time.

However, times have moved on and I think it's time for the web development community to move on from MVC. That's because modern websites cannot be easily divided into three parts (M, V and C). For example, let's suppose you have a JSON file that defines the routing for some API endpoints. Which folder does that fit into?

It is the models folder? Certainly not! It has nothing to do with data!

It is the views folder? Again, no. There's no HTML or any viewable / presentation content at all.

How about the controllers folder? Once again, no. That's because there's no PHP computation required. We're just doing some routing for some endpoints!

What's very clear is that modern web applications require an architecture that is a bit more portable and flexible than MVC. This is the topic of conversation here.

PLEASE NOTE: This video is part of a series on PHP from intermediate to advanced.
Рекомендации по теме
Комментарии
Автор

I've been a one man band since 2016 when I moved to PHP. I'm enjoying your perspective. Please keep going. Your doing a great job!!

phpcoderusa
Автор

ambiguity about the Model ? EXAAAACTLY !! Thank you

thehunter
Автор

i personally love the front controller pattern. clean URL's are the best. somehow this all leads to using mvc :D

TomiBorchert
Автор

The API driven architecture has really made an impact on the web development community to a point where you can see the flaws of an MVC architecture.

sentgine
Автор

I’ve got notifications set to “all” for your channel and YouTube still doesn’t notify me if you upload a video, they must have you on some sort of list lol

ElLevidente
Автор

I agree that PHP has become more difficult. And it seems that some in the community embrace these changes. As I write this I wonder if they embrace it because it makes it easier to justify their rates and maybe it makes them more valuable because things are more difficult. I was at a PHP meetup a while back and asked if there was a shortage of PHP developers. The group said "yes". Then a young guy said "qualified developers". I've always hated that part of the developer community. I've been programming for decades and I've always hated the prima donnas!

phpcoderusa
Автор

For me this is so timely. I recently built an e-commerce store for a friend recently made redundant. It was based on procedural code that I wrote 6-7 years ago and I've been properly learning OOP, with a view to it being MVC based. As I've progressed, I've had an eye to the future and potentially building more sites using this 'framework' and discovered the same issue with MVC with regard to a very modular approach (which I believe is the only future for commercially-viable web development). My approach has been to largely stick with MVC as a concept but have modules which each contain a controller and view folder, containing the approriate files.

GavinCox
join shbcf.ru