Which Implementation?

Author Topic: Which Implementation?  (Read 602 times)

Offline chinmay.sahooTopic starter

  • Trade Count: (0)
  • Full Member
  • ***
  • Thank You 2
  • Posts: 139
  • Karma: 0
    • No Addiction
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
8 Replies
Last post 08-30-2016, 02:51:11
by TomClarke
0 Replies
Last post 02-01-2016, 08:13:54
by accidentalseo
0 Replies
Last post 09-23-2016, 03:54:31
by aarav