Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am creating a web application using PHP. I am doing my best to implement an MVC structure based on my understanding. I am not using a framework such as Laravel, etc.

Currently I am implementing it with the Controller as procedural and the Model and View as OOP with classes etc. The controller of course will instantiate and utilize the objects of the model and view, but other than that the controllers themselves are strictly procedural.

Is this a perfectly fine implementation? Or is there a benefit to making the controllers OO as well?

Update:

I think some people were confused as to what I meant by procedural programming. Basically, what I meant is that the controller does not use the class keyword. Whereas the model and view components are themselves classes. While the controller itself operates in a procedural fashion it does use the new keyword to instantiate the view or model and makes use of those objects. For further clarification Wikipedia provides a brief article on the differences between procedural and object oriented programming.

If you need further clarification please just ask rather than downvoting.

If this update helps clarify things please vote to reopen the question. If the question is not clarified please let me know what is not clear.

share|improve this question

put on hold as unclear what you're asking by Ixrec, Robert Harvey, Scant Roger, GlenH7, MichaelT 2 days ago

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question.If this question can be reworded to fit the rules in the help center, please edit the question.

5  
What exactly do you mean by making the controller procedural? – David Packer Jan 10 at 7:39
    
I mean that the controller does not use the "class" keyword. Whereas the model and view components are classes. – kojow7 2 days ago
1  
I have updated my question to include this. – kojow7 2 days ago
    
@kojow7 You may have heard this one before: Use a framework. All of this and much more will come built into it and also you won't have to worry about properly implementing MVC. The caveats of doing something like this yourself always show all but too late in the development. – Alternatex 2 days ago
1  
@kojow7 MVC is in no way related to OOP. As long as you follow its rules you can implement it in whichever way you like. Is this a perfectly fine implementation?. We can't tell because we haven't seen any code. Or is there a benefit to making the controllers OO as well? There is a benefit to making everything OO and if you've already done such programming as I assume you have you'd already know the advantages of OOP over procedural programming. – Alternatex 2 days ago