Aug 24
Gc.Collect(ADO.NET);
ok so ADO.Net is garbage. in fact, its the perfect example of poor object orientation. The factory that exists for the current version is basically non-existant.
i have been working on writing generics for database INdependent code, which is more challenging than you might imagine. in ADO.Net 1.0/1.1, you have to create seperate DataStore provider objects for communicating with different databases. rather than having a decent factory with a good api, they allowed each provider to basically use a seperate api.
what’s microsoft’s suggestion? use an enum/switch technique, which would give Kay (robbins for you non-utsa cs grads) a heart attack.
so my work-around is to mask the Provider object’s type behind a wall of imported DLL code. that means that in a library that’s already being implemented, i keep track of said provider object by the aforementioned enum/switch technique. in doing so, it’s actually cleaner for me to hide the provider objects completely.
i have managed to squish the code needed to communicate with a provider down to a half-dozen lines of code. it can manage a pool of connections to multiple providers. it can also obscure the data access via IDataReader, IDbConnection, IDbCommand, IDbDataParameter, and IDbDataAdapter. pretty slick. i’d post an example, but im sure my employeer would be opposed to that.
on a more positive note, im starting a poker night. last week, everyone showed up sporatically. this week, i have more people showing up. there should be 6 people so far, not including myself. the only problem is i dont have enough room at my dining table for that many people….
No Comments
Leave a comment