R – Should the MVC controllers be object-oriented

frameworksmodel-view-controlleroopperltemplate-toolkit

I'm making a Perl website, and I'll using Template Toolkit (for the view), a whole bunch of objects for DB interaction and business logic (the model), but I'm wondering: should the controllers be OO?

I feel like they should, just for consistency, but it also feels it might be a bit redundant when I'm not interacting with the controllers in an OO way. The controllers are called more in a fire-and-forget kind of way.

Thanks for any thoughts.

Best Answer

In my opinion, if it feels reduntant, you shouldn't use it.

OOP can have more cons than pros if you use it on a project that doesn't need it.

If it's just about consistency just drop it. there's plenty of people that (for example) in c++ use stl but write the rest of the code in a procedural way. If you feel OOP overwhelming go for the mixed approach you are thinking of using (OOP where needed, procedura the rest), as long as your code doesn't become difficult to read because of this.