3

I'm looking for a good framework for PHP and see most offer the MVC approach, are there any other (or better) design methods/approaches that would be considered more efficient or best practice? MVC is starting to look dated but I wanted to know if it's still considered the industry standard.

PeeHaa
  • 71,436
  • 58
  • 190
  • 262
Phill Pafford
  • 83,471
  • 91
  • 263
  • 383
  • 4
    What is making MVC look dated? Identify that, and you have a search term you can use. – Quentin Sep 14 '09 at 13:23
  • I've been hearing about MVC for about three years now, just figured something better always comes along and wanted to know if this is still considered the standard or is something better coming down the pipeline? – Phill Pafford Sep 14 '09 at 13:48
  • 1
    MVC is 20 years old or so - and it still works. What're you missing? – skrebbel Sep 14 '09 at 13:51
  • I'm not missing anything but there is one aspect of MVC I don't like, it's the code integration with HTML. Not a big fan of having all these open/close PHP tags throughout the HTML document, looks sloppy. I prefer to have PHP generate the HTML, is this considered bad practice? Wanted to know what alternatives to MVC there are, not saying anything is wrong with that approach just looking for alternatives – Phill Pafford Sep 14 '09 at 13:59
  • 1
    There's nothing about MVC that says you have to do your view layer that way. You could apply any templating system you want. Smarty. XML/XSLT. PHPTAL. Whatever. – Peter Bailey Sep 14 '09 at 14:24

4 Answers4

0

MVC is still the industry standard for every Object Oriented web development language.

However you are afforded some alternate routes:

  1. Micro Frameworks (Google Them) (which most often still use MVC design patters, just not as formalized and some not in an Object Oriented fashion)
  2. Event-Based Frameworks (like PRADO)

However beyond those routes you are a bit out of luck as far as I know.

Thanks Xeoncross, forgot to add the "micro usually are still mvc" caveat

dcousineau
  • 2,202
  • 18
  • 24
  • Xeoncross: hmm, I thought I had added that in (I had a long post I was writing then scrapped it and wrote the shorter version)... – dcousineau Sep 15 '09 at 20:08
0

Well, in all truth MVC is actully misleading when it comes to most frameworks. I don't know of any PHP system that is only based on Models, Views, & Controllers. Most of them also use functions, libraries, configs, and caching levels as well.

MVC is merely a starting point stating that abstraction of your CRUD from your business logic and views is good a good thing! From there you can abstract as much more of the system as you want from template parsers to libraries that calculate physics.

Xeoncross
  • 55,620
  • 80
  • 262
  • 364
  • Even pure MVC doesn't preclude libraries and other abstractions. MVC by definition is the code execution path only flows between models, views, and controllers with those areas only performing certain tasks. Technically a 3rd party library for physics calculation would be considered a model, as (contrary to some popular belief) a model is not exclusively a table gateway class as some frameworks might lead one to believe. – dcousineau Sep 15 '09 at 20:13
0

I would recommend symfony framework as my ideal ;)

http://www.symfony-project.org/

Vladislav Rastrusny
  • 29,378
  • 23
  • 95
  • 156
0

The only PHP frameworks that I am aware of that are well tested use the MVC pattern however there has been some web based frameworks that use the Naked Objects pattern for other languages like Java.

In case you are interested it looks like there is at least one Naked Object framework under way for PHP also here:

Naked object PHP blog

Community
  • 1
  • 1
Jai
  • 366
  • 2
  • 8