The Artima Developer Community
Sponsored Link

Java Buzz Forum
The Singleton Anti Pattern?

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Thomas Woelfle

Posts: 4
Nickname: woelfle
Registered: May, 2007

Thomas Woelfle is a Java developer with strong interest in functional programming
The Singleton Anti Pattern? Posted: May 2, 2007 3:38 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Thomas Woelfle.
Original Post: The Singleton Anti Pattern?
Feed Title: Woelfles Welt
Feed URL: http://woelfle.blogspot.com/feeds/posts/default
Feed Description: A Developers Diary
Latest Java Buzz Posts
Latest Java Buzz Posts by Thomas Woelfle
Latest Posts From Woelfles Welt

Advertisement
While refactoring some eclipse plug-ins I've realized again that to me the well known singleton pattern becomes more and more an anti pattern.
At a first glance it looks like a useful pattern to make some class accessible from everywhere. But after some time one begins to recognize the problems that come up with singletons. I've you've ever tried to write a unit test for a class that makes use of a singleton you know what I mean.
But the most critical problem comes up with singletons is that you are probably not aware of the dependencies introduced between classes and components. And dependency management is one of the most difficult things when developing code and one of the most expensive things when it comes to maintenance.
So using a pattern which does not support me handling my dependencies but which makes dependency management more difficult seems to me more of an anti pattern than a pattern.

Read: The Singleton Anti Pattern?

Topic: [Apr 26, 2007 12:45 PDT] 10 Links Previous Topic   Next Topic Topic: New VMWare Images for Debian Etch, CentOS, and etc

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use