View Single Post
Old 08-17-2008, 06:21 PM   #5 (permalink)
delayedinsanity
is cute and cuddly
 
delayedinsanity's Avatar
 
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
delayedinsanity is on a distinguished road
Default

I use a (probably bastardized) version of the registry pattern, which I understood to be an extension of the Singleton pattern, minus the addition of the getInstace() method in each class. So with the exception of a few variations in the pattern to incorporate factories, I make wide use of the constructor and wasn't thinking along the same line of what you're trying to present. I guess you can chock that up to the time of night.

Wait Just A Minute... I still don't get it. What's wrong with calling the constructor in a singleton? You're calling a method called 'construct' which just seems hackish to make something similarily named anyways, isn't it? Why not use the constructor already available to the class - regardless, it's still being stored in a static location, and you can still run an initial check to make sure it's an instance of Singleton first.

I may not understand, I'm not very educated in design patterns, despite trying to learn, but it just seems to me there's no reason why not to use the constructor.
-m
delayedinsanity is offline  
Reply With Quote
The Following User Says Thank You to delayedinsanity For This Useful Post:
Theo (08-17-2008)