How would you test that?Jeroen Oosterlaar wrote:Hi raghavan20,
Why are you passing a database connection object to your objects data management objects? As far as I know, that is not necessary. Once you have created a connection, everything that is executed during the request, can execute transactions freely. So when you have a page script that first initializes the database connection and then invokes some method that executes some database transaction, that object doesn't need to have an expliciet reference to the database connection (object). The connection is 'just there'.
Members class-OO: Suggestions solicited[Unsolved]
Moderator: General Moderators
-
Jeroen Oosterlaar
- Forum Commoner
- Posts: 37
- Joined: Sun Nov 06, 2005 4:12 pm
Isn't that the responsibility of the code that calls the object? In my opinion, taking care of the database connection should not concern such objects, but they should be able to assume there is a connection available. I think that separated database connection managing is preferable.sweatje wrote:How would you test that?
- raghavan20
- DevNet Resident
- Posts: 1451
- Joined: Sat Jun 11, 2005 6:57 am
- Location: London, UK
- Contact: