SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Apr 2005
    Posts
    39
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    XML and Foldertree issues

    Hi there.

    I've just started on a new project, which size is bigger than anything I've ever done before.

    Now before the questions, about my project. It's browserbased game that I've been thinking of doing since, well, a long time. While developing this game I'll also develop my personal framework. This isn't a big deal thing, just a way for me to create a standard for my applications, add "some" basic functionallity, make my life easier when I run of onto my next project et cetera.

    My first question, how do you manage to keep large PHP applications organized. I'm actually talking about the foldertree. I've been looking into a few framework projects, but I was hoping I could get some feedback on how you keep your big application organized and managable.

    The second question, the game will be using allot of items. All types of items that have to be dynamic in all kind of ways. An example would be,
    An item can be different types, bags/weapons/artifacts etc. Have multiple stats enchangements and all different from the other item. To manage this and to be able to add new item types and such it will be required for me to make a pretty devided database, lots of tables. Now, if I want to print out an item, it would have to go trough multiple tables, which is no biggie as long as it's "one" item or a few, but what If i need like 30+ items. Using joins to get all that just seems like a waste.
    So the solution would be XML for me. Which is nice IMO. My question (finaly) is, would it be bad to use XML for this, since I will have like one XML file per item. The count could go up to over 10.000 items, would this affect benchmarking bad in some way? Any ideas or suggestions are more than welcome.

    Yours,
    Martin fl0w Iwanowski

  2. #2
    SitePoint Wizard chris_fuel's Avatar
    Join Date
    May 2006
    Location
    Ventura, CA
    Posts
    2,750
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    Actually, I disagree on the XML part, that will actually be slower in the long run. Databases are meant for dealing with large sets of data, and yes even doing strange table joins. You've yet to behold the wonder of the 13 table left join, and for the love of God I hope you never do Anyways, look at some database design books, links, etc. (you can find them over in the DB forum) and hopefully it will make better sense.

  3. #3
    SitePoint Enthusiast
    Join Date
    Apr 2005
    Posts
    39
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Really?

    Then why would one ever use .xml files?
    Sorry, more of a XML question I guess, but since I've made this thread already ..

    Why would it get slower? Is it because of the parsing made by PHP?
    I was thinking of using .xml files, and only update them when database is updated. So, I have a sql database that keeps everything and to ease searches (and whatnot), and to have the .xml files to work as an activerecord which I update only when a client updates the database. But I guess I was on the wrong road here?

  4. #4
    is_empty(2); foofoonet's Avatar
    Join Date
    Mar 2006
    Posts
    1,000
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am not following you on the activerecord front (having read a LOT about that in the last 2 days) but a question on the xml...

    Can you give a small example of how you see one of your xml files looking?
    Will you be using the xml file in more than one way? (ie transforming it)

    as for 10,000 files, you could arguably reduce seek time by having a logical folder tree (was that your original point?)

    Are you on PHP5?
    Upgrading to Mysql 5? Auto-increment fields now strict
    use NULL
    Or zero or leave the field name out completely.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •