homepage Welcome to WebmasterWorld Guest from 54.161.155.142
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Converting a site to OO php
performance hit?
dingman




msg:1281315
 2:29 am on Sep 29, 2002 (gmt 0)

Ok, so I've got a community site that I wrote from scratch starting this past Spring, using PHP and PostgreSQL. It works pretty well, and I even have a group of people who use it in preference to a Yahoo! group. I'm still working on the code, though, and I'm thinking about re-working it using classes and inheritance.

The design is one that would convert to an OO paradigm very easily, even though I haven't used explicit OO features of PHP so far. What worries me is performance issues. The page consists of a framework that makes a DB connection, authenticates users, displays a header, footer, and navbar, and calls one of its components to fill in the 'main' content area. The navbar can be added to by each component by defining a function of a certain name in a particular file within the component's directory hierarchy. These are pretty light-weight functions, and therefore should take little time to parse and execute. This is good, because it means that for any given page view, I only load an execute the bulk of a component's code if it's actually being used. If I make the components into objects, and the navbar function into a method, is there any way to keep from loading the entire bulk of every component on every page view?

 

jatar_k




msg:1281316
 6:53 am on Sep 29, 2002 (gmt 0)

I don't understand, if it works well as is and you are concerned that with the change it may increase load times why change?

dingman




msg:1281317
 7:11 am on Sep 29, 2002 (gmt 0)

Because about half the reason for writing all this is as an excercise in expanding my PHP skills :)

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved