mbannonb
01-18-2008, 08:36 PM
I have two separate sites that share the same code base.
I have a class called itemObj() and it contains the methods and properties for managing virtual item content on each site.
Here is what I was doing:
Setting the data in a file local to each site. http://gcgz.com/data1.txt
When I created an instance of itemObj, I would pass in the data from the local file to the class. http://gcgz.com/obj1.txt
This creates multiple places for maintenance as I use itemObj() on multiple pages and I'm sure can't be the best.
So I am having the original class have an empty construct(). http://gcgz.com/obj2.txt
And everywhere the itemObj class is included, I am also including a local itemLocalObj class that 'extends' itemObj. The itemLocalObj is what will be initialized and used everywhere.
http://gcgz.com/obj3.txt
While this seems a lot easier than the original solution I was using, I want to make sure I've got it right.
Any thoughts are appreciated.
I have a class called itemObj() and it contains the methods and properties for managing virtual item content on each site.
Here is what I was doing:
Setting the data in a file local to each site. http://gcgz.com/data1.txt
When I created an instance of itemObj, I would pass in the data from the local file to the class. http://gcgz.com/obj1.txt
This creates multiple places for maintenance as I use itemObj() on multiple pages and I'm sure can't be the best.
So I am having the original class have an empty construct(). http://gcgz.com/obj2.txt
And everywhere the itemObj class is included, I am also including a local itemLocalObj class that 'extends' itemObj. The itemLocalObj is what will be initialized and used everywhere.
http://gcgz.com/obj3.txt
While this seems a lot easier than the original solution I was using, I want to make sure I've got it right.
Any thoughts are appreciated.