Fog Creek Software
Discussion Board

Welcome! and rules

Joel on Software

OO Design Pattern for DBobjects

Hey, ive been doing alot of reading on OO Design  patterns and Im thinking of a pattern I would like to implement for all my projects.

Say you have a user table, how would you structure your objects to access that information? 

I was thinking using the 'abstract factory' kind of setup,

myUser = DBEngine.GetSingle(userID, Cuser);

Latley ive been going through the Microsoft IBUYSPY portal and ive really liked how they use stored proedures for all their data access, but i really hate how they instaniate a new myConnection and myCommand in every function.

I dont know, im looking for a really solid way have resuable code.

any ideas?

Andrew McTeer
Friday, November 1, 2002

There are tools like LLBLGen from Let us know what you think, I haven't had the chance to really try it yet.

Friday, November 1, 2002

mb! thank you, what a wonderful tool, Im just starting to play around with it but this will help me so much!

Ill be sure to let you know how well this works!

Thanks again!

Andrew McTeer
Monday, November 4, 2002

Hey just an update, ive been playing around with that Datatier generator and so far so good!  A few quirks here and there but still saves me a huge amount of time!

Thanks for the link!

Andrew McTeer
Thursday, November 7, 2002

I'd take a look at the Fitch and Mather example.

The IBuySpy is garbage IMHO. Buy, I guess it depends what your goals are. Fitch and Mather gets you a little closer because it has a DB object that can control transactions and such.

But it seems like you are on teh right path. Creating objects is a great way to go. You can make a few objects into a nice application in a VERY short period of time.

Good luck,


Ryan Greenwell
Thursday, November 14, 2002

*  Recent Topics

*  Fog Creek Home