Home | FAQ | Server | Presentations | Mailing Lists/Archives | Member Tools | Links | Sponsors | Contact| I'd second that motion. I've got an app I'm working on right now, where I essentially create a number of classes. A data class, data factory class, and a display class. The datafactory is all I'd need to change if I had to change databases. It's the only thing that knows anything about the database. Now, related to that, to really be abstract I'd have to have another layer which talks to the database, i.e. data factory database. The problem is that after a certain point, abstraction is too much abstraction :) In other words, for the java app I'm working on, it isn't worth my time to try and set another level of abstraction - what I've got works well. Now, I could use other components for abstract database calls, but for optimization issues, that's far less efficient. Further, when you consider things like record locking (in a stateless web environment, VERY tricky), having a class which talks to the database directly is handy. I haven't found a decent way other than the 3-class method which works well for programming. I tried once to do a more dynamic object loading system, but found in some ways it was more work than it was worth. Hmm, wish there was a "programmers" emailing list to discuss stuff like this. I've got a few forums I talk on, but it's mostly bug discussions there, not "concepts" - i.e. how to do db row locking in a stateless environment. Oh, let me finish off by one last comment - it IS good to use classes and includes in PHP rather than have the calls in the php file directly. Do an include on your database handler code, so you've got one place to make changes to the database calls - makes the code a lot cleaner, IMHO. Classes - i.e. object oriented programming - makes application design a LOT easier too. Jason -- /--------------------------------------|---------------------------\ | Jason McIntosh | CELL: 573-424-7612 | | Webmaster, thinker, programmer, etc. | WORK: 573-884-3865 | | http://poetshome.com/ | | |------------------------------------------------------------------| |"How should I know if it works? That's what beta testers are | |for. I only coded it." | |(Attributed to Linus Torvalds, somewhere in a posting) | \--------------------------------------|---------------------------/ GnuPG Key: http://poetshome.com/about/jmcintosh_mlug.missouri.edu.gpgkey On Mar 28, 2006, at 11:46 PM, Michael wrote:
|
_______________________________________________ members mailing list EMAIL:PROTECTED http://mlug.missouri.edu/mailman/listinfo/members