Re: Singletons in PHP



"Willem Bogaerts" <w.bogaerts@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message news:4750130c$0$237$e4fe514c@xxxxxxxxxxxxxxxxx

As with so many things, you don't really NEED them. Singletons are (or
are often abused as) global variables: You never know when these objects
are constructed, and have very little control over it. When it comes to
unit testing, they can be a real pain in, you know where.
The main problem is that they do not abide the Law of Demeter: they do
not come in through the interface of your objects.

Willem - could you explain that last sentence, please?


.



Relevant Pages

  • Re: First Project Advice - Conclusion.
    ... Jim Cooper wrote: ... things like unit testing, version control and build management in more ...
    (borland.public.delphi.non-technical)
  • Re: How to return values - best solution ?
    ... Microsoft IT Academy Program Mentorhttp://microsoftitacademy.com/ ... text box control - Text1 ... I looked into using a global variables and the OpenArgs property, ...
    (microsoft.public.access.formscoding)
  • Web.config best practices in ASP.NET apps?
    ... It seems to make more sense to separate app settings (e.g. global variables, ... constants that the development team would control) from web settings (e.g. ... database connection strings) that the operations team would control... ...
    (microsoft.public.dotnet.languages.csharp)
  • Best way to unit test .NET usercontrol hosted in IE
    ... The control interacts with javascript both via method ... how do I automate clicks (the control only has buttons) ... Then I thought maybe I should just write a .NET windows app and embed ... What are others doing in terms of unit testing .NET user controls ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • Re: Talking to multiple GUI
    ... I got most of the multiple gui control working using the ... global variables approach. ... type application where I have the plot in one figure and the ... VCR controls in the other figure. ...
    (comp.soft-sys.matlab)