View Single Post
Old 08-10-2004, 09:06 AM   #2 (permalink)
RelaX
Follower of Ner'Zhul
 
RelaX's Avatar
 
Location: Netherlands
First off, kudos for wanting to do the right thing, instead of just another hack-job.

Second, on the database issue, I would go for a singleton design pattern (if you don't know anything about design patterns, look it up on wikipedia.org or something, it's amazing stuff), just make sure that you have one instance of a database object that does all the queries and has a persistent connection.

Third, if you really want to do something right, you begin with design. I would suggest you check out UML and make a couple of use-cases and a class diagram. Personally I always make ERDs and flow-charts as well, because they are more ways of thinking through the problem/situation and class diagrams can quickly become more about the solution.

Fourth, document. I dunno if you've ever seen the movie Memmento (I love that movie, in case you haven't seen it though, it's about a guy with no long term memory), but the guy from that movie should even be able to work with your code. Keep every function nice and short and well documented (in something like phpDoc or JavaDoc maybe?). This will SIGNIFICANTLY help prevent code reuse and save time in the long run.

This is my $0.02 anyway.
__________________
The most likely way for the world to be destroyed, most experts agree, is by accident. That's where we come in; we're computer professionals. We cause accidents.
- Nathaniel Borenstein
RelaX is offline  
 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73