|
Posted by Jerry Stuckle on 07/25/07 11:36
Michael Fesser wrote:
> .oO(Toby A Inkster)
>
>> Michael Fesser wrote:
>>
>>> They are perfectly OOP, whenever you have to make sure that there's
>>> always exactly one (not more, not less) instance of a class.
>> I agree with Sanders here: they're inconsistent with OOP theory.
>
> OK, but IMHO that's just a philosophical problem.
>
> Micha
Yes, it's a philosophical problem, but I don't see anything in OOP
theory which rules out singletons. In fact, I think OO helps with
singletons.
After all - a singleton is part of the implementation of that class.
The fact it is a singleton is hidden from the rest of the code. And if
you change the code so that it's no longer a singleton, it doesn't
affect any of the rest of the code (as long as you don't run out of
external resources).
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
[Back to original message]
|