No video

Singleton Design Pattern in Java - part I

  Рет қаралды 137,883

Ranjith ramachandran

Ranjith ramachandran

Күн бұрын

Singleton design pattern tutorial - Here I discuss why Singleton design pattern is not as simple as you thought.There are many ways you can break a singleton implementation and hence it is very hard to get right.
Please think twice next time before you say that singleton design pattern is your favorite design pattern.
In part 2 I will discuss how to address these and Singleton vs. class with static members/methods.
Please subscribe to the channel for interesting updates.
#singleton #javaprogramming #java #javainstitute #class #tutorial #easylearning #easy #fypシ #fypシ゚viral #trending #india #fyp #tutorials #interview #interviewquestions #interviewtips

Пікірлер: 147
@ranjithramachandran5928
@ranjithramachandran5928 9 жыл бұрын
Singleton design pattern comes with a few flaws.. so beware before making it your favorite..
@0806410050
@0806410050 6 жыл бұрын
Really this video is very helpful.
@yathishkb4245
@yathishkb4245 5 жыл бұрын
Thank you. Its really a nice video. Also for info when using multi-thread, I feel synchronize could help by not creating new instance and achieve singleton. ??
@VIVEKSINGH-pc4lb
@VIVEKSINGH-pc4lb 5 жыл бұрын
Sir problem u explain regarding Reflection is not problem anymore with new version of java. I t was for previous version
@basavaraj4663
@basavaraj4663 4 жыл бұрын
Why you havnt made videos on remaining design patterns ?
@vinaykaple1663
@vinaykaple1663 4 жыл бұрын
you should upload more videos on different topics... your explanations are fantastic sir
@sachinsharma2907
@sachinsharma2907 2 жыл бұрын
I have watched this video 4-5 years ago and I have answered many questions after watching this knowledgeable video. Again I came back here for my interview preparation and also recommended it to my colleagues . This is the best way any one can explain it. Thanks for sharing and helping us. I hope you make more such videos. All the best.
@marekbugiel6893
@marekbugiel6893 7 жыл бұрын
Seen many Java tutorials on yt, this one is one of the greates if not simply best.
@travelkhor
@travelkhor 8 жыл бұрын
Stumbled upon this randomly and found a gem. Brilliant explanation. Thanks
@nitinkhulbe6234
@nitinkhulbe6234 3 жыл бұрын
very good explanation hats off you sir
@aj8387
@aj8387 3 жыл бұрын
@Ranjith ramachandran - I don't know why you stopped making videos now but your videos are best out there and great explanation.
@rahullko28
@rahullko28 6 жыл бұрын
Absolutely fantastic, looking forward for some more vedio on design patterns.
@vasuudayar3691
@vasuudayar3691 3 жыл бұрын
plz do more java videos u r an awesome teacher. i love to share your channel with my frnds
@Mec387
@Mec387 3 жыл бұрын
Simply the best tutorial in Singleton Pattern. Please, keep making more videos on design patterns.
@ILuvBilli
@ILuvBilli 5 жыл бұрын
Wow, best way to understand Singletons👍👍👍
@anilpal8333
@anilpal8333 4 жыл бұрын
Usefull
@mritunjayyadav3788
@mritunjayyadav3788 4 жыл бұрын
great video sir
@sajvuchanxu8329
@sajvuchanxu8329 3 жыл бұрын
Fantastic
@uma_mataji
@uma_mataji 3 жыл бұрын
I wish I had watched this tutorial before. Awesome explanation, thank you.
@anjibabugottapu7963
@anjibabugottapu7963 5 жыл бұрын
Ranjith we are waiting to see videos on remaining design patters. I request you to please do videos on remaining design patterns.
@gauravsuhane6521
@gauravsuhane6521 5 жыл бұрын
Great explanation with examples. Keep posting more design patterns and enterprise solutions
@sinnumunnu
@sinnumunnu 5 жыл бұрын
Wow wonderful explainantion.. looking for more tutorials from u.
@sha_patil
@sha_patil 8 жыл бұрын
awesome tutorial.. thanks for sharing with us..
@manishankershukla1082
@manishankershukla1082 7 жыл бұрын
After watching all your videos I am craving for more Java knowledge...Please keep posting more videos about Spring,Hibernate,REST ,Theading....I am big fan of yours
@gunturmanju
@gunturmanju 6 жыл бұрын
Excellent Video Ranjith. Best one so far on web which explains in detail with code from violation standpoint. Thank You!
@prakashkchauhannn
@prakashkchauhannn 7 жыл бұрын
Nice and Simple explanation. Thank you.
@AHMEDISIIAMINE
@AHMEDISIIAMINE 4 жыл бұрын
Thanks from tunisia ;)
@divyashreemh3950
@divyashreemh3950 4 жыл бұрын
Awsome video, sir please upload more video about all Design pattern and data structures.
@ashishchaurasia5270
@ashishchaurasia5270 5 жыл бұрын
Best Explanation, Thank you for such a nice video
@kunalrai7577
@kunalrai7577 7 жыл бұрын
Exceptionally awesome video
@domfp133
@domfp133 8 жыл бұрын
Nice video, it's the best explanation I've seen
@AmitKumar-qh4ow
@AmitKumar-qh4ow 8 жыл бұрын
Best Tutorial for Singleton. Thank you so much
@tiruc
@tiruc 9 жыл бұрын
Very nice explanations !!! all doubts about violation of Singleton pattern has been cleared, exciting to watch Part-2. Please do you it your earliest convenience, really appreciate your effort and details on the topics.
@ranjithramachandran5928
@ranjithramachandran5928 9 жыл бұрын
tirupathi c Thanks! it is coming out this week, please subscribe to the channel for updates.
@saktiranjanbehera7010
@saktiranjanbehera7010 5 жыл бұрын
Nicely described.Thanks a lot.As many of them not did it before you did it well like problematically.
@paranthamanrajendran9385
@paranthamanrajendran9385 9 жыл бұрын
Very nice ans deep explanations !!! , expecting more topics in different areas, great works
@AjeetKumar-rv6yh
@AjeetKumar-rv6yh 4 жыл бұрын
I am your big fan.. Your explanation with these deepest knowledge is amazing.. I salute to your case study for this topics.. I hope you will continue to share this important information with us. 🙏🙏
@bnr6012
@bnr6012 6 жыл бұрын
awesome. Explained very nicely.
@mukeshsinghdance7332
@mukeshsinghdance7332 6 жыл бұрын
Greats explanation I ever found. Thank you very much.
@EatCodeTravelRepeat
@EatCodeTravelRepeat 5 жыл бұрын
Really helpful video. Thank you for your great efforts.
@aviralbhardwaz5485
@aviralbhardwaz5485 7 жыл бұрын
from the scratch.........awesome
@vinodbhadu4576
@vinodbhadu4576 7 жыл бұрын
Awesome and very informative video, Thank you Ranjith Sir.
@deeptik9865
@deeptik9865 7 жыл бұрын
Nicely explained.
@RiyazParasara
@RiyazParasara 5 жыл бұрын
It's a really very very good explanation. Good job.
@viveksingh-us8il
@viveksingh-us8il 7 жыл бұрын
Your slides are awesome and really informative.
@shashankgupta2526
@shashankgupta2526 7 жыл бұрын
very nice video
@pankajbalodi6265
@pankajbalodi6265 6 жыл бұрын
Great explanation... Fan of your knowledge
@murtazabagwala7678
@murtazabagwala7678 8 жыл бұрын
Awesome explanation and very well researched Thanks
@aniket4650
@aniket4650 6 жыл бұрын
please cover other design pattern too, best ever video
@mayankmehta7606
@mayankmehta7606 7 жыл бұрын
very nice and detailed explanation Ranjith. Highly appreciable work! Awaiting for your next videos.
@piotr.kwiatkowski
@piotr.kwiatkowski 9 жыл бұрын
This. Was. Deep. THANK YOU!
@plat4n0
@plat4n0 4 жыл бұрын
Thanks for the great explanation!
@neerajjassal8750
@neerajjassal8750 8 жыл бұрын
Really good bro, very nice and easy explanation
@RaviKumar-kx1yc
@RaviKumar-kx1yc 8 жыл бұрын
thanks.. for uploading this video.. nice sanrio
@ravirai5439
@ravirai5439 4 жыл бұрын
It's really great explanation and really helpful for interview. Please upload for other design pattern also.
@SACHINBHIMANI12
@SACHINBHIMANI12 5 жыл бұрын
Great explanation...!!!
@DurgeshKumawatdk
@DurgeshKumawatdk 7 жыл бұрын
best explanation
@murugesanrethiam3951
@murugesanrethiam3951 6 жыл бұрын
Excellent video....
@leowilliams6848
@leowilliams6848 6 жыл бұрын
Boss!!! Excellent Tutorial.
@vpkgv9221
@vpkgv9221 6 жыл бұрын
The BEST to CORE . Thanks in ton Ranjith. It is to the point. Hope u do some videos on Spring framework.
@Sethorion99
@Sethorion99 8 жыл бұрын
Good video! Well explained.
@LetsBeHuman
@LetsBeHuman 5 жыл бұрын
Sir, please do more vidoes. I'm sure people won't mind you paying for it via patreon. If you feel, you don't have time, at least suggest us the materials you used to gain this knowledge. You are good to lot of people, as you teach us. Thanks. Please come back. Please.
@hwangclara4024
@hwangclara4024 6 жыл бұрын
very nice... thanks so much
@harishdeore453
@harishdeore453 4 жыл бұрын
Thanks for the videos. If possible can you please add Java 8 videos.
@zaktv3595
@zaktv3595 6 жыл бұрын
great explanation, thank you very much
@sanjaybharkatiya
@sanjaybharkatiya 9 жыл бұрын
very nice explained.. kudos to you..best explanation i can say..please add more into design patterns tutorials..
@ranjithramachandran5928
@ranjithramachandran5928 9 жыл бұрын
+sanjay bharkatiya Thanks, Please check the channel, I have a part 2 to this and then factory-method pattern video. Hope you find it useful.
@skyglacierfunny
@skyglacierfunny 8 жыл бұрын
well explained...
@sajidcis
@sajidcis 6 жыл бұрын
fantastic explanation
@yanitwinkle
@yanitwinkle 8 жыл бұрын
good explanation...
@VAR2024
@VAR2024 5 жыл бұрын
Super video sir
@rups4343
@rups4343 9 жыл бұрын
Thanks Sir,..Very meticulous ....
@gaurmmec
@gaurmmec 9 жыл бұрын
Thanks Ranjith, nicely explained and well researched. Keep up the Good Work.
@inkuban
@inkuban 4 жыл бұрын
Remarkable!
@harishkumargudivada1732
@harishkumargudivada1732 7 жыл бұрын
hi ranjith its a great explanation .i have learned new things like executorservice and executor and great explanation on singleton.i know only few flaws on singleton desighn pattern before listening to your video. thanks a lot and make more videos lie this
@crosseyewatch
@crosseyewatch 7 жыл бұрын
Thanks!
@rizanamatya9191
@rizanamatya9191 7 жыл бұрын
Thank you for the video. Best video
@321842
@321842 7 жыл бұрын
Great
@renanlopes9144
@renanlopes9144 6 жыл бұрын
Thanks, it helped a lot!
@chandru95666
@chandru95666 8 жыл бұрын
Really very useful video Ranjith.You are a right person to ask this question . After I completed my graduation ,I got a chance to work in J2EE application. I had struggled lot and completed my project.bec I dont know anything about java. After that I had worked with few big clients in J2EE projects So my question is ,should J2EE developer have strong knowledge in core java (Like thread ,String pooling,heap,stack,i/o operations). Though we are working in web application we know how to get data from db,display in web page ,validations &securities. So how much knowledge the web application developer should possess.Since Java is very vast,I don't think everyone can learn everything. Please clarify my doubt. Note: I am working in Spring MVC ,JS/JQuery ,angular js and little bit Struts(worked 4 big projects).but I dont feel that I am strong in Java.
@divyasingh7727
@divyasingh7727 5 жыл бұрын
Thanks Ranjith, Nicely Explained..
@nehapatel1133
@nehapatel1133 Жыл бұрын
Sir when will you come back. Please do give us some knowledge on Microservices.
@amitpawar3167
@amitpawar3167 8 жыл бұрын
thanks ....video very helpful for me .. .
@sunilmali8483
@sunilmali8483 6 жыл бұрын
Nice
@prabhukalshetti8002
@prabhukalshetti8002 8 жыл бұрын
Thanks .. Nice explanation..
@gunasekhar9638
@gunasekhar9638 7 жыл бұрын
thanks for the amazing videos.... could you please upload the remaining videos on design patterns...... once again thank you so much... keep it up for your good work.. :-)
@everything_rj
@everything_rj 5 жыл бұрын
great explanation Thanks :)
@SuprajaYKM
@SuprajaYKM 9 жыл бұрын
Very well explained, thanks!
@preechabootwicha3521
@preechabootwicha3521 7 жыл бұрын
Supraja Chamarthy
@jagadeeshp4708
@jagadeeshp4708 7 жыл бұрын
good
@lifebyvivek
@lifebyvivek 7 жыл бұрын
First of all, thanks a lot ranjith, your videos are very helpful and descriptive. Also the selection of topics is also very good, the kind-of topics that you are covering are the most complicated and missed out once. Can you please also consider sharing some sessions on : - Java Concurrency - Browser memory model and rendering of HTML ( like the way, JVM operates to run java code, how browser sends requests, receives response, how it gets read and interpreted and lastly rendered )
@crosseyewatch
@crosseyewatch 7 жыл бұрын
Yes, I really would like to put some topics out. Only constraint is time. I will try my best to release some videos soon
@prannoysingh966
@prannoysingh966 7 жыл бұрын
Great video, Thanks Ranjit :):)
@kallachaitanya2132
@kallachaitanya2132 7 жыл бұрын
Sir plz make more videos. Your videos are very helpful . Thanks a lot.
@crosseyewatch
@crosseyewatch 7 жыл бұрын
Only constraint is time. I will try my best to release some videos soon
@kallachaitanya2132
@kallachaitanya2132 7 жыл бұрын
Can you plz post some real time work flow that includes exception, flow of data from database to DAO layer, services, control and JSON object parsing using angular or jQuery . I am interested in learning the real time approach and it is most use full to many ppl.
@Justinwk11
@Justinwk11 9 жыл бұрын
Thanks A lot. Great Explanation!
@sremayeedebbarma1162
@sremayeedebbarma1162 9 жыл бұрын
Very very Nice Tutorials.. I am following all your tutorials. Just one request. Could you please provide links for the code that you write in the tutorial for reference. Thanks in advance !
@wBacz
@wBacz 7 жыл бұрын
more videos bout patterns, please.
@KrishnaPrasad-qt7ke
@KrishnaPrasad-qt7ke 6 жыл бұрын
Thanks a lot Ranjith.
@josephstanley7202
@josephstanley7202 9 жыл бұрын
sir you are awesome
@vijayarahavan956
@vijayarahavan956 3 жыл бұрын
Hi @Ranjith, Please let me know What's the scope of Singleton? Whether it's a classloader level or JVM level?
@moem9315
@moem9315 5 жыл бұрын
So.. just to be clear --> if you don't make your singleton class implement Cloneable or Serializable, you aren't vulnerable to breaking this pattern. The only ones i think that apply here are Reflection and the multi-threaded used case you described above, am i correct ?
@veeraarunkumarveeranki9601
@veeraarunkumarveeranki9601 7 жыл бұрын
Hi Ranjith, Great explanation, I need to know the absract factory and abstract design patterns. Can you explain in your feature videos.
@GiridharKN
@GiridharKN 9 жыл бұрын
nice .. thanks Ranjith :)
@vs7035
@vs7035 6 жыл бұрын
please post more videos..
@sreekanthjanapati409
@sreekanthjanapati409 4 жыл бұрын
nice explanation, may i know how have you created this app? , means which software have you used?
@harishchowdarysure8858
@harishchowdarysure8858 8 жыл бұрын
I have a one class who contain 5 methods But my requirement is in between 5 methods I want to apply locking mechanism that multiple thread can’t access at a time but rest 3 methods can be access by multiple thread at a time NOTE:Without using Synchronized key word. please answer this question
@ranjithramachandran5928
@ranjithramachandran5928 8 жыл бұрын
You already know that applying synchronized keyword to the 3 out of 5 will make them blocking in terms of concurrent access. But you can not use synchronized. But you will have to use some locking constraint. java.util.concurrent.locks.ReentrantLock has the same functionality as the lock you access when using synchronized. Using the lock semantics you can "lock" the instance right at the beginning of your method and then "unlock" at the end (probably in a finally{} block)
@shadabakhtarofficial1564
@shadabakhtarofficial1564 8 жыл бұрын
please tell me what is the difference b/w java & C++ singleton class ??
@navchabbewal7554
@navchabbewal7554 9 жыл бұрын
so will making lazy initialization part as "critical section" with some mutex will solve to problem in multi thread env to get only one singleton?
@ranjithramachandran5928
@ranjithramachandran5928 9 жыл бұрын
+Nav Chabbewal , yes but there are some challenges. Have a look at my second part on this. kzfaq.info/get/bejne/fa5lks-Zq7nMlok.html
@saidsenhadji
@saidsenhadji 7 жыл бұрын
super!!
@jaganr5725
@jaganr5725 7 жыл бұрын
Nice explanation for singleton. i have a question in Spring singleton scope. i defined bean as singleton with some bean setters and getters of primitive data types.Now i loaded this bean and set the values to the bean.And in other class i loaded same singleton bean. so will i get the default singleton bean or already set the values bean?? awaiting for reply.
@ranjithramachandran5928
@ranjithramachandran5928 7 жыл бұрын
Not sure if i really got your question. In Spring beans are created only once and given to you whenever you look it up from spring's context. But this is not always true. No one is stopping you from using new operator or due to some bugs you would even be able to load duplicate contexts thus leading to non-singleton kind of behavior.
Singleton design pattern in Java - Part 2
33:00
Ranjith ramachandran
Рет қаралды 62 М.
10 Design Patterns Explained in 10 Minutes
11:04
Fireship
Рет қаралды 2,2 МЛН
SCHOOLBOY. Последняя часть🤓
00:15
⚡️КАН АНДРЕЙ⚡️
Рет қаралды 8 МЛН
Little brothers couldn't stay calm when they noticed a bin lorry #shorts
00:32
Fabiosa Best Lifehacks
Рет қаралды 16 МЛН
Magic trick 🪄😁
00:13
Andrey Grechka
Рет қаралды 26 МЛН
How to BREAK and FIX Singleton Design Pattern | Interview Question
19:32
Daily Code Buffer
Рет қаралды 31 М.
Equals and hashcode contract
13:50
Ranjith ramachandran
Рет қаралды 86 М.
Top 25 Microservice Interview Questions Answered - Java Brains
39:54
Singleton and Double Checked Locking
7:57
Defog Tech
Рет қаралды 31 М.
Strategy Pattern - Design Patterns (ep 1)
35:11
Christopher Okhravi
Рет қаралды 1,4 МЛН
Java Strings are Immutable - Here's What That Actually Means
7:06
Coding with John
Рет қаралды 610 М.
Singleton Design Pattern in Java
11:34
Coding Simplified
Рет қаралды 137 М.