Building a CMS or other scripted site, is there a build order/workflow?

Associate
Joined
4 Dec 2003
Posts
643
I want to build myself something basic either in PHP or ASP.NET, to learn to use them, and was wondering what is the order of activities is when building something like a CMS or a very crude and basic shopping cart system?

I am aware of setting up Apache, MySQL and the like as I tried it once before and followed a step by step tutorial but this time I'm serious and am looking to produce something of my own.

Does one start with planning the database and your pages, creating it, populating it and then move onto creating a login system and then the administrative functions, or the public side..are there modules such as this or is it all coded page by page, eg Login page, admin, page, inventory page.

What I'm trying to get a handle on is where the dependencies lie for creating such sites/systems before I start and an idea of how others here go about such things. I always have a problem getting my head around such things and will be wondering about the general concepts as I read through the basics of operators, functions and methods :(

Your ideas, thoughts and help are apprecitated :)
TIA
 
Well, I always get some A4 paper and start drawing out the database. First, list what information you need to store (e.g, product name, price, username), then try to categorise them into groups - these form your database tables, e.g. "products" and "users".

From there, I would setup the server so it can handle PHP/MySQL, and then start creating the folder structure. For me, this is generally something like this:
/admin
/config
/images
/lib
/templates
index.php

From there, I start to develop the modules that will be used on the site as PHP Classes Wikipedia ) which are effectively self-contained units. I normally have Database, User, Page and Util classes.

After I have this structure setup, I get on with the rest of the stuff. If you haven't done Object Orientated Programming before, I'd suggest having a look round for some articles about doing it with your chosen language. Zend.com has quite a few PHP articles on this subject. Does things this way will save you quite a bit of time when developing. Instead of having to write full HTML for each page of the software, you could simply write something like this:
Code:
$Page = new C_Page();
$Page->grabData("Home");
$Page->setPageTitle("This is the homepage");
$Page->display();

The C_Page class could then handle the rest, parsing your template with the appropriate data etc, and writing it out to the page. Seems like a lot of work, but it will save you oodles of time in the long run :)

I seem to have rambled a bit, but remember, this is just my way of doing things. Try to find a structure you are comfortable working in, and it will do you good for many projects after.

Cheers,
Matt
 
I forgot all about this post :)

Thanks for your reply. I'm following a bunch of Microsoft video tutorials and had a quick gander at the W3C tutorials for ASP.net. Following your route, I've planned out my database on paper...seeing as I'm just learning it probably isn't efficiently designed but I'll work on that one later, I just need some data moving to pick up some concepts.

The table adapter things are quite handy and apparently save me a lot of coding :D
 
Back
Top Bottom