Jump to content

OOP - Address Bar / Link Class


johnsmith153

Recommended Posts

I am thinking of creating a class that will be instantiated first in all scripts and will gather all details of the url entered and store as properties of the class. I use mod_rewrite so the url needs to be split up and stored in various ways.

 

This class would deal with all POST and GET variables and be pretty important and used a lot.

 

If a link needs generating (so to convert the current one into the mobile site one) or some other server-side generation then this class would also provide the results for that.

 

If a server-side redirection was needed then this class would do that.

 

(1) Does this sound like good OOP design as I'm not sure?

 

(2) The problem is that this class would be used so many times by nearly all other classes that I don't know how to make the instance available to these other classes. It could be used by every class.

 

Global??

 

Passing in to EVERY other instantiated class??

 

Neither seem a great idea.

Link to comment
Share on other sites

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.