Jump to content

Recommended Posts

I'd appreciate the community's opinion on this.

 

Here is a purist OOP application design I am considering. I am curious as to how much this is going to affect performance with the multiple classes I am using. FYI... I am using PHP5, MySQL5, PEAR and Smarty.

 

1. Every call/postback to my website is going to go through index.php?function=xxxx

2. In index.php I instantiate a 'driver' class I have

3. That driver class/file is going to include_once() all of my business tier files/classes. It will call the business tier, get the data back, and then display the smarty page.

4. All of the business tier .php files are going to include their own data tier files/classes.

5. The data tier is the *only* place you will find SQL. It will build the queries, call PEAR, and return the data to the business tier.

 

Thought 1 : I am thinking that I can save on performance by getting rid of what I am calling a 'data tier'. PEAR is really my data tier. So in my business classes I will have my SQL coded and just have the business class call PEAR to execute the query.

 

Thought 2 : I can also go ulti-purist, get rid of my data tier, and put all of my sql into stored procedures.

 

Your thoughts ?

 

Thanks in advance,

Patrick

 

Link to comment
https://forums.phpfreaks.com/topic/99392-big-performance-hit-on-this-design/
Share on other sites

The JAVA programmer in me is used to a header full on require_once() calls. I really prefer using it that way. If I ever write a basic testcase at the bottom of the file then I don't have to worry about dependencies in other 'packages' (again, the java thing.)

 

Here's what the structure of my app looks like, Patrick: http://nick.stinemates.org/work-desktop.png . Ignore the python on the right :X

 

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.