The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
1answer
140 views

Is using Singleton correct for Jtree & DefaultTreeModel?

Basically I have one Tree view which uses a single DefaultTreeModel. Is it okay to use singleton for Tree extending JTree and another singleton for TreeModel extending DefaultTreeModel? If not, what ...
1
vote
6answers
2k views

Static classes and/or singletons — How many does it take to become a code smell? [closed]

In my projects I use quite a lot of static classes. These are usually classes that naturally seem to fit into a single-instance type of thing. Many times I use static classes and recently I've started ...
12
votes
5answers
920 views

What to say to your boss if they want you to use a global variable

I am currently 4 months into an internship, and when reviewing my code, my boss didn't like that I had kept a specific object local to a number of methods across a few separate classes within one ...
25
votes
7answers
2k views

The Singleton Pattern [duplicate]

Possible Duplicate: When is Singleton appropriate? I am a new programmer (4 months into my first job) and have recently taken an interest in design patterns. One that I have used recently ...
13
votes
5answers
6k views

What is the difference between all-static-methods and applying a singleton pattern?

I am making a database to store information about the users of my website (I am using stuts2 and hence Java EE technology). For the database I'll be making a DBManager. Should I apply singleton ...
4
votes
2answers
348 views

Are the default objects of VB a type of singleton?

Are the default objects supported by My keyword in VB.net is a kind of singleton? If not, what is the difference? Again is this "default object" feature is something useful? If yes, then why it is ...
11
votes
4answers
835 views

Does “notification center” pattern encourage good or bad program design?

Sometimes I come across these message-hub-style APIs, for example the Cocoa NSNotificationCenter: ...
41
votes
5answers
3k views

When is Singleton appropriate?

Some hold that the Singleton Pattern is always an anti-pattern. What do you think?