Change Player Size
Watch this video in a new window

The Singleton Design Pattern

An explanation of the Singleton design pattern and its purpose. Great wikipedia entry: http://en.wikipedia.org/wik... And this one which I now think is inappropriate, but which I mentioned in the...  
 
Customize

More From: codingkriggs

Loading...

QuickList(0)

Upgrade to Flash Player 10 for improved playback performance. Upgrade Now or get more info.
17 ratings
Sign in to rate
7,816 views
Want to add to Favorites? Sign In or Sign Up now!
Want to add to Playlists? Sign In or Sign Up now!
Want to flag a video? Sign In or Sign Up now!

Statistics & Data

Loading...

Video Responses (0)

This video has no Responses. Be the first to Post a Video Response.
Sign in to post a Comment

Text Comments (12)   Options

Loading...
mahcuz (3 months ago) Show Hide
 0
Marked as spam
You're such a typical newb; learn something new and you're suddenly an expert on the subject.
dittonamed (3 months ago) Show Hide
 0
Marked as spam
he said LIE-BARRY at 1:24. ouch
kinkokonko (5 months ago) Show Hide
 0
Marked as spam
Singleton is the most well known anti pattern in OO. Please dont encourage it. Plus the example of db pools is shit, what happens when you want to employ diffent strategys in different environements, or mock the behaviour?

Singleton == SHITE
polehole234 (10 months ago) Show Hide
 0
Marked as spam
waste of time , this guy is so close to the monitor
jinfrics (1 year ago) Show Hide
 0
Marked as spam
The Object Singleton will not dispose until program exit. why because of using 'STATIC'

how we can assure that this class will not instantiate by another object?

NOTICE the "PRIVATE Constructor" he wrote of a "Singleton CLASS"

but not recommend this in the multithreading.
mahcuz (3 months ago) Show Hide
 0
Marked as spam
Learn. English.
johannazeul (1 year ago) Show Hide
 0
Marked as spam
I find it original ! and kind !
gamccoy (1 year ago) Show Hide
 0
Marked as spam
You forgot to talk about the singleton in a multi-threaded environment. If you don't do it properly, you will get multiple instances!
codingkriggs (1 year ago) Show Hide
Marked as spam
Yes, I indeed didn't mention that. However, this is an introduction for those who haven't yet been introduced to design patterns, so I'm keeping it simple. The wikipedia entry I refer to has a wide range of solutions for all kinds of languages, including a few multi-thread safe ones for java. I hope you find what you need there.
gelien333 (1 year ago) Show Hide
+1
Marked as spam
If you implement a singleton in Java please dont do the assignment of your singleton variable in the constructor. This is an unneccessary waste of resources (check for null every time you want to get your singleton). Do it at its declaration. This also prevents you from synchronizing access to the singleton to make it threadsafe.

Would you like to comment?

Join YouTube for a free account, or sign in if you are already a member.