mrdiesel
unread,Jan 3, 2012, 3:36:56 AM1/3/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mongodb-user
I want to use mongodb for a project.
OK yes, i able to connect to it and do things.
However, I want to be able to wrap the mongodb driver around a wrapper
so if i want to change the database, i want to be easily change it.
Repository pattern looks like something I can use with Mongodb, but I
m kinda over thinking where to start the connection? should i use a
singleton ?
Mongodb docs says that it is thread safe, so if i create a single
MongoServer and single MongoDatabase classes via Singleton and per
collection, I can have a method that return a collections.
Is this a bad design?
What would be a better design?
I want to use singleton to create connection to database cause I dont
want to keep creating connection per thread, if there is already a
persistent connection.
any experience with this?