kristoferdoman
Member
- Joined
- Nov 21, 2012
- Messages
- 9
- Programming Experience
- 3-5
I'm not sure if the title is very good, I'll explain.
Maybe I'm thinking about this too much, but lately I've been really trying to construct well designed classes and libraries.
Anyways, I'm trying to design a library which basically handles all of the communication to a particular database. So, for instance, as an example, I'm going to have an orders class, which will handle getting, updating information in an orders table, and an order_items class which will do the same. Now my question is, instead of passing a database connection string to the shared instance method of the class, or the class itself, is there a good way in which I can have this library (in a sense) instanced while my application runs so I could just make calls like Order.GetOrders() or OrderItems.GetItems() without passing a connection string everytime?
Maybe I'm thinking about this too much, but lately I've been really trying to construct well designed classes and libraries.
Anyways, I'm trying to design a library which basically handles all of the communication to a particular database. So, for instance, as an example, I'm going to have an orders class, which will handle getting, updating information in an orders table, and an order_items class which will do the same. Now my question is, instead of passing a database connection string to the shared instance method of the class, or the class itself, is there a good way in which I can have this library (in a sense) instanced while my application runs so I could just make calls like Order.GetOrders() or OrderItems.GetItems() without passing a connection string everytime?