I ran into a problem when trying to get the object to return a list. This has given me time to kinda rethink some of the choices I've made.
I've never liked the internal object, but didn't know of a way I would like better. I'm wondering if it would be better to have Methods to get the internal information instead of Properties. So I could call something like
self.Column("Name"); and it would return a column name that was associated with the Propriety Name. Table could still be a Property, I see no reason why it shouldn't be.
While looking at other implementations of database object I've seen that they normally have a kind of master DB object. So you can do things like
users = db.Select( "SELECT * FROM user"); (I'm looking towards Google's app engine here.) I don't have any core object in my design. I'm not sure if that is a good thing or not.
A problem I ran into so having to have an object already to call it's select. A Factory object would help with this. Something like
DBFactory.Select( User, "Name = ?1", "Chris" ) would be nice. As long as I'm thinking about this route,
List myusers = DBFactory.Select( typeof(User), "Age >= ?1 AND employed = ?2", 21, true ); Might be Idea. This is inspired by google's model. The only down side is that I can't build in custom filters on the list. So Instead of getting one list of all users over 21 and being able to get just the employed and then just the unemployed without ever making another DB call. The user has to either do the filter themselves, or (more likely) make the DB call twice (eww).
On the otherhand, if the DBFactory was global, it could keep a cache of the results it's returned and do the filter itself?