Object-oriented data abstraction and caching strategies
I'm not sure if anyone reads blogs on the weekends, but what the heck. :)
I've been thinking a bit about the way I get data in a lot of apps I write, and it's typically something like the article I wrote on uberasp.net. I have some kind of class that has the typical CRUD stuff and properties that match columns, with lots of caching. This works really well, particularly in the forums, where pages get rendered in .05 seconds or less. (Actually, the data access is generally in yet another class, so that article isn't exactly the way I generally do things.)
This class design is great for straight-forward data selection, but it's not quite as straight forward when you do joins. For example, in a forum topic I might get all of the posts as well as user data to display (their post count, signature, or whatever). Sure, each Post object could have a User object as a property, but then I start to worry about the caching, and all of the performance that brings. I may cache a collection of Post objects for as long as the topic isn't changed, but what happens when an individual user changes their sig or increases their post count? The data in the cached topic is then too old.
I probably shouldn't be thinking about this on a Saturday night, having a beer on the deck waiting for friends, but what the heck, I'm still a geek, even with the beer. What would you do?