kaeverens / kvwebme

kvwebme
4 stars 5 forks source link

send all database queries through a single class #23

Open kaeverens opened 10 years ago

kaeverens commented 10 years ago

the class should be abstract enough that it can eventually be pointed at any database at all, or a NoSQL solution.

I'm particularly interested in this because I find I'm doing a lot of database caching these days to try speed things up, and those caches take the form of JSON files. if we were using a NoSQL solution, they would already be in that form.

also, NoSQL solutions don't have schemas, so we can update schemas as we need them.

kaeverens commented 10 years ago

started work on this.

I'm currently finding all cases where a database query is run to find information based on an ID, and replacing those queries with calls to initialise objects of that type instead. for example, instead of requesting the "name" value of a "products" table row of instance $id, I get Product::getInstance($id) and get name from that.