If you like SEOmastering Forum, you can support it by - BTC: bc1qppjcl3c2cyjazy6lepmrv3fh6ke9mxs7zpfky0 , TRC20 and more...

 

Which Implementation?

Started by chinmay.sahoo, 05-30-2016, 06:57:01

Previous topic - Next topic

chinmay.sahooTopic starter

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.



If you like SEOmastering Forum, you can support it by - BTC: bc1qppjcl3c2cyjazy6lepmrv3fh6ke9mxs7zpfky0 , TRC20 and more...