Which Implementation?

Author Topic: Which Implementation?  (Read 1164 times)

Offline chinmay.sahooTopic starter

  • Trade Count: (0)
  • Full Member
  • ***
  • Thank You 2
  • Posts: 158
  • Karma: 0
    • We Helpline
Which Implementation?
« on: 05-30-2016, 05:57:01 »
This revised MySQLConnect class has exactly the same functionality as the original.Apart from the way an instance is created, there is no other change to the interface of the MySQLConnect class. However, having a copy of the lone instance stored in a static class variable allows you to return that instance instead of throwing an exception, should an attempt be made to create a second instance. This is exactly what some implementations of a singleton database class do, but it is not always the desired behavior. What if the user
wants to connect to a different server? For this reason, in the section “Making  Other Connections” on page 68, we chose to force the user to close the current connection before creating a new one.


Related Topics

  Subject / Started by Replies Last post
7 Replies
Last post 08-30-2016, 02:51:11
by TomClarke
0 Replies
Last post 02-01-2016, 08:13:54
by accidentalseo
1 Replies
Last post 07-20-2017, 03:55:22
by mishraviplav7877