Jump to content


Structuring..


3 replies to this topic

#1 Wolfe

    Young Padawan

  • Members
  • Pip
  • 102 posts
  • Gender:Male
  • Location:Louisiana

Posted 30 November 2006 - 09:23 PM

I'm soon planning on picking up my newest project for what I hope to become a largely distributed script. It's going to be as user-friendly as I can possibly make it. I'm going to be using PHP, MySQL, AJAX, and, of course, HTML/CSS.

My main concern is the file structuring. I usually use Object Oriented Programming in most of my professional themed scripts, so I'm used to structuring pretty well; however, this will be my first time implementing, on a large-scale, JavaScript for the AJAX.

So, in short, I want to get opinions of how I should seperate, include, and all that jazz all the files. I want to know the most efficient way to structure the entire system. I'm looking for a way similar to that of IPB. Although, not as complex as IPB.

And besides just the file structure, what method would be best for including them?

Thanks for the help. It is much appreciated.

Edited by Wolfe, 30 November 2006 - 09:27 PM.


#2 Demonslay

    P2L Jedi

  • Members
  • PipPipPip
  • 970 posts
  • Gender:Male
  • Location:A strange world where water falls out of the sky... for no reason.
  • Interests:Graphic Design, Coding, Splinter Cell, Cats

Posted 30 November 2006 - 09:43 PM

I usually have something whereas I have all my classes in a folder (one class per file works quite well). You should probably have this above the public root directory as usual. Then, I usually have one configuration file that contains all my includes and initiations of the mandatory classes (such as MySQL handler, member class, ect) and some little functions such as cleaning user input, and so on. I then have this configuration file included into my index page, which of course is the main page that includes all the rest of the content.
I also have a folder where I keep all my AJAX response scripts, so they are organized, and I can have on main action per file (such as one for managing member functions, one for searching, comment functions, etc).
I then have on file for all my general JavaScript actions, and one for all my member actions (which is only included if the user is logged in obviously). Then, all my admin files are of course completely seperate and such.

All really depends on your preferences. Some people like one huge, honkin' do-it-all kind of file or folder, some like to spread the hell out of it.
:)

#3 Chaos King

    Senior Programmer

  • P2L Staff
  • PipPipPip
  • 676 posts
  • Gender:Male
  • Location:Florida

Posted 30 November 2006 - 10:00 PM

Quote

AJAX is not a language, merly a technique. :)

Sorry, I had to say it. <_<

#4 Wolfe

    Young Padawan

  • Members
  • Pip
  • 102 posts
  • Gender:Male
  • Location:Louisiana

Posted 30 November 2006 - 10:30 PM

View PostDemonslay, on Nov 30 2006, 09:43 PM, said:

I usually have something whereas I have all my classes in a folder (one class per file works quite well). You should probably have this above the public root directory as usual. Then, I usually have one configuration file that contains all my includes and initiations of the mandatory classes (such as MySQL handler, member class, ect) and some little functions such as cleaning user input, and so on. I then have this configuration file included into my index page, which of course is the main page that includes all the rest of the content.
I also have a folder where I keep all my AJAX response scripts, so they are organized, and I can have on main action per file (such as one for managing member functions, one for searching, comment functions, etc).
I then have on file for all my general JavaScript actions, and one for all my member actions (which is only included if the user is logged in obviously). Then, all my admin files are of course completely seperate and such.

All really depends on your preferences. Some people like one huge, honkin' do-it-all kind of file or folder, some like to spread the hell out of it.
:P

I'm more of the spread it the hell out type. It was mainly the JS seperation I was concerned about. I was thinking along those lines.

Thanks.

View PostChaos King, on Nov 30 2006, 10:00 PM, said:

Quote

AJAX is not a language, merly a technique. :D

Sorry, I had to say it. :)

When did anyone refer to AJAX as a language?





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users