Singleton Design Pattern | Implementation with details & code ✌🏻

Keerti Purswani
Keerti Purswani
58.1 هزار بار بازدید - 3 سال پیش - Really really wanted my first
Really really wanted my first YouTube video this year to be a Tutorial! It’s a symbol that this year is going to be filled with a LOT of tutorials - starting with finishing 𝐃𝐞𝐬𝐢𝐠𝐧 𝐏𝐚𝐭𝐭𝐞𝐫𝐧 𝐒𝐞𝐫𝐢𝐞𝐬.

Today’s video is on 𝐒𝐢𝐧𝐠𝐥𝐞𝐭𝐨𝐧 𝐃𝐞𝐬𝐢𝐠𝐧 𝐏𝐚𝐭𝐭𝐞𝐫𝐧. I know most people think they know this design pattern as it’s a basic and common one, but there are details to it that we end up missing. Making the code thread safe and efficient is important when it comes to implementing the code.

So, obviously. I have covered everything with code in detail. Link is in comments. Please keep sharing your feedback.

If you guys really want educators to be motivated and create a lot of tutorials, please do support us - just a like, share or subscribe can mean a lot to us. Trust me - a LOT of effort goes behind these videos!

𝐂𝐡𝐞𝐜𝐤 𝐨𝐮𝐭 𝐄𝐝𝐮𝐜𝐚𝐭𝐢𝐯𝐞 𝐡𝐞𝐫𝐞-
http://educative.io/keerti

Educative Unlimited-
Educative.io/unlimited

You can get 𝐃𝐈𝐒𝐂𝐎𝐔𝐍𝐓𝐒 using code "KEERTI" -
➡️ On 𝐂𝐨𝐝𝐢𝐧𝐠 𝐍𝐢𝐧𝐣𝐚𝐬 - https://bit.ly/CodingNinjas-12
➡️ On 𝐈𝐧𝐭𝐞𝐫𝐯𝐢𝐞𝐰𝐑𝐞𝐚𝐝𝐲 - https://get.interviewready.io/?_aff=K...
➡️ On 𝐄𝐝𝐮𝐜𝐚𝐭𝐢𝐯𝐞 - http://educative.io/keerti
➡️ On all 𝐆𝐞𝐞𝐤𝐬𝐅𝐨𝐫𝐆𝐞𝐞𝐤𝐬 paid courses - https://practice.geeksforgeeks.org/co...

Please 𝐬𝐮𝐛𝐬𝐜𝐫𝐢𝐛𝐞 here - keertipurswani

You can also connect with me on-
𝐈𝐧𝐬𝐭𝐚𝐠𝐫𝐚𝐦 (for not so professional, chill side of my life) - https://www.instagram.com/keerti.purs...
𝐓𝐞𝐥𝐞𝐠𝐫𝐚𝐦 Channel - https://t.me/keertipurswani
𝐓𝐰𝐢𝐭𝐭𝐞𝐫 - https://twitter.com/KeertiPurswani?s=09
𝐋𝐢𝐧𝐤𝐞𝐝𝐈𝐧 - LinkedIn: keertipurswani

𝐂𝐡𝐞𝐜𝐤 𝐨𝐮𝐭 𝐭𝐡𝐞𝐬𝐞 𝐩𝐥𝐚𝐲𝐥𝐢𝐬𝐭𝐬-
𝐌𝐨𝐜𝐤 𝐈𝐧𝐭𝐞𝐫𝐯𝐢𝐞𝐰𝐬 - Mock Coding Interview with incoming S...
𝐃𝐞𝐬𝐢𝐠𝐧 𝐏𝐚𝐭𝐭𝐞𝐫𝐧𝐬 -
Intro to Design Patterns | What, Why,...
𝐃𝐒𝐀 - Median of 2 Sorted Arrays of differen...
𝐃𝐲𝐧𝐚𝐦𝐢𝐜 𝐏𝐫𝐨𝐠𝐫𝐚𝐦𝐦𝐢𝐧𝐠 - Burst Balloon Problem | Dynamic Progr...
𝐇𝐨𝐧𝐞𝐬𝐭 𝐂𝐨𝐧𝐯𝐞𝐫𝐬𝐚𝐭𝐢𝐨𝐧𝐬 -
Meet Hiring Manager at Intuit - Know ...
𝐂++ - VTable & VPointers - Virtual function...
𝐁𝐚𝐬𝐢𝐜𝐬 𝐨𝐟 𝐈𝐧𝐯𝐞𝐬𝐭𝐦𝐞𝐧𝐭𝐬 - What are IPOs? How to apply, analyse?...
𝐋𝐢𝐟𝐞 𝐚𝐭 𝐈𝐧𝐭𝐮𝐢𝐭 - Meet my Manager at Intuit | His journ...
𝐒𝐡𝐨𝐫𝐭𝐬 - Floor, Ceil use for Problem Solving ⌛...
𝐂++ 𝐒𝐓𝐋 - What is C++ STL? Why do we need it? I...
𝐓𝐫𝐞𝐞𝐬 & 𝐆𝐫𝐚𝐩𝐡𝐬 - BFS, DFS|Explanation with examples, C...
𝐖𝐢𝐭𝐡 𝐏𝐚𝐩𝐚 - Explaining OOPs concepts to Papa!! 🤪😆🤭
𝐒𝐲𝐬𝐭𝐞𝐦 𝐃𝐞𝐬𝐢𝐠𝐧 - Factory Design Pattern - Why and How ...
𝐏𝐚𝐢𝐧𝐭𝐢𝐧𝐠𝐬 - Wall Art | SwitchBoard Paintings | Ho...
𝐕𝐥𝐨𝐠𝐬 - Best Ladakh Bike Trip Ever!!! 🔥🔥Sonam...

The video contains following parts-
0:00-1:45 - Intro of Singleton Design Pattern
1:45-2:08 - Educative Promotion
2:08-4:45 - Simple Logger Class Code
4:45-6:33 - Count instances of Logger
6:33-7:25 - Restrict Logger Instantiation
7:25-11:52 - Simple Singleton Implementation
11:52-15:32 - Code fails in MultiThreading Case
15:32-17:20 - Thread Safe Singleton
17:20-19:03 - Double-checked Locking
19:03-20:15 - Points to keep in mind!

#designpatterns #singleton #systemdesign #softwareengineering
3 سال پیش در تاریخ 1400/10/16 منتشر شده است.
58,184 بـار بازدید شده
... بیشتر