n3p3 Posted February 10, 2008 Share Posted February 10, 2008 Why we/you use OOP instead of procedural coding while constructing the backbone of the site? In MVC pattern, we only use once this "controller" class, and also the so-called base class is actually a collection of generic functions. And derivatives of that are again adds some functions and uses some of those generic functions. So instead of creating a differen derivative of controller object everytime(where we again need to include the class' definiton file) we can simply include the needed file and call the needen function. Again in this general controller-view structure. Quote Link to comment https://forums.phpfreaks.com/topic/90409-oop-or-procedural-coding-mvc/ Share on other sites More sharing options...
Xeoncross Posted February 10, 2008 Share Posted February 10, 2008 I personally use both to power my sites. Everything that could possibly be contained within as a class/object that could be used more than once (or transfered to another system) I place within a Object. Things like form creators that handle every aspect of creating forms for me. Or my image class that can resize, crop, and thumbnail any type of image. These things make great objects because then I can use them anywhere in my code or even rip them right out and move them to another site without re-coding anything. But the procedural coding is used on the index page to load all objects and run them and return the output of all the plugins, functions, and classes. Hand-in-hand - the best of both worlds Quote Link to comment https://forums.phpfreaks.com/topic/90409-oop-or-procedural-coding-mvc/#findComment-463543 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.