Wednesday, February 25, 2009

Static again

I haven't been able to work on this for a while because of school and work. I was rereading my last post and I noticed that I have to create a new DBUser in order to get the SelectQuery for it. I don't like this, it violates my 'new' rule. One of the reasons it's not a static method is because it caches the query string. But it doesn't really matter if it caches the query if you call a new object each time, it eliminates the point of the cache.

So this is where I'm going to pick things back up, I'm going to make those two static and post the code.

The only problem is, how so I make these static? The base needs to know the child's type to work. When they wheren't static I could just use the this keyword. But as a static methiod I no longer have access to that keyword. The only alternative I can think of off the top of my head is requireing a type passed to both methods. I don't know that I quite like that idea.

No comments: