3 ms·
I've never been that enthusiastic about OO but I've recently become a convert to a particular case. Perl's CGI::Application module makes your whole website a si
by lupin_sansei 19y ago
I've never been that enthusiastic about OO but I've recently become a convert to a particular case. Perl's CGI::Application module makes your whole website a single class, and each page in that site is a method in the class. I believe web.py is similar in idea. So rather than a folder full of scripts for each page you just have a single script which contains the code for all the pages of the site.
Having your whole site as a single class is convenient firstly as your constructor can handle the code that's common to each page, though you don't necessarily need OO to do this. Where this OO approach really shines thought is that you can create a more general web site class such as an online shop, and then subclass it for a particular instance of a shop for a client.