Click here to Skip to main content
15,944,390 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,
Where can we use Singleton design pattern in real time other than creating database connection object?
Thanks in advance.
Posted
Comments
Sergey Alexandrovich Kryukov 22-Oct-13 22:48pm    
Real time? What do you mean?! Do you really work on a real-time platform? I doubt it, frankly...
—SA
Sergey Alexandrovich Kryukov 22-Oct-13 22:49pm    
Again, not a very productive question. First learn how singleton works and what it does.
—SA

1 solution

Please see my comments to the question. First of all, finally realize that you are not working in real time. What do you even mean? Just a misnomer. Don't use words if you have no clue what they mean.

Now, you need to learn how singleton works and what it does. Please see:
http://en.wikipedia.org/wiki/Singleton_pattern[^] (Java code sample is included here).

Then, the problem is the this is the second your question which give strong impression that you are not learning programming but trying to learn how to talk about programming. I sometimes call it "blah-blahology" :-). The thing is: to learn programming, you should solve problems. When you people problems, the usually find out that they really want to use a singleton, even where more experienced developer would avoid it. So, the real knowledge is learning how to avoid singletons, and the problem where to use them is usually never even posed. When you are solving many problem, it comes to your mind very often. If I gave you just one example, it would only push your out of understanding of this problem.

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900