PHP Classes

Omg Singleton?

Recommend this page to a friend!

      PDO MySQLi MySQL Class  >  All threads  >  Omg Singleton?  >  (Un) Subscribe thread alerts  
Subject:Omg Singleton?
Summary:Pleeaase let it not be a Singleton!
Messages:2
Author:rudie dirkx
Date:2011-01-26 15:01:32
Update:2011-01-26 16:35:19
 

  1. Omg Singleton?   Reply   Report abuse  
Picture of rudie dirkx rudie dirkx - 2011-01-26 15:01:36
Without reading the actual class code...

If you made the database connection a Singleton, you must be the dumbest shit ever. But I'm pretty sure you didn't do that...

Just because you get the instance with a static function, doesn't make it a Singleton. Look it up.

  2. Re: Omg Singleton?   Reply   Report abuse  
Picture of Jason Gerfen Jason Gerfen - 2011-01-26 16:35:19 - In reply to message 1 from rudie dirkx
Using class methods to disable cloning and deserialization while ensuring only one instance exists is not a singleton?

Why wouldn't you want to prevent multiple instances?

I really want to hear your logic genius