Это видео недоступно.
Сожалеем об этом.
Singleton Design Pattern explained in Hindi (हिंदी) with code example C# | Design Patterns Series
HTML-код
- Опубликовано: 29 апр 2023
- In this video, we will discuss about the singleton design pattern. What is the problem it solves, the code structure of the pattern and code example of using this pattern.
Recommended readings:
Clean Architecture: A Craftsman's Guide to Software Structure and Design : amzn.to/3VLJaXc
Design Patterns: Elements of Reusable Object-Oriented Software: amzn.to/3B4zr4P
Head First Design Patterns: amzn.to/3B4ZTLJ
Singleton is a creational design pattern, which ensures that only one object of its kind exists and provides a single point of access to it for any other code.
Topics covered:
Introduction to Singleton design pattern
Problem statement
Solution provided
Code Structure
C# Code example
Lazy implementation
Double checked locking
#designpatterns #cleancode
---------------------------------------------------------------------------------------------
My setup:
Mic: amzn.to/44HGe1H
Laptop: amzn.to/3pclzTe
Keyboard: amzn.to/3B3e3Nn
Mouse: amzn.to/3VLKB82
very nice explain
Thank you.
nice
Great Explanation You have solved my Headache
Mostly interviews asked this ...on how you can make single pattern thread safe !!! BTW very nice ...God bless you
Very comprehensively described !
Nice and clear concept explanation thanks
Great knowledge i appreciate you 🤗
thanks Sir, Very well explained
Excellent
Thank you so much for making video on pattern could you pls make on all patterns
ruclips.net/p/PLmzGdRRZtjPfkKJroG4fHSKquN5AIpHw3
Dose it require to make class as Sealed?
It's not mandatory but if you don't make it sealed then someone can create a child class and create multiple objects of the child class. Sealed class will prevent the inheritance.
Great explanation, Do you have video on Factory Patter as well ?
ruclips.net/video/I2DbKwKHeUA/видео.html
Thanks for the great explanation Sir !! . However, I have a question on lock mechanism . Suppose there are two threads trying to create singleton instance then how is the lock deciding which thread should go first?
It is a very rare condition for 2 threads to try to acquire a lock at exactly same time but in that case there can be internal thread priorities which can be used. In any case, lock will prevent the threads to execute the code at same time.
Thanks for the reply sir 👍
Can you made tutorial on blazor with entity framework
Is it the same way we create singleton class ?
Yes, using singleton pattern and creating a Singleton class is same thing.
It's showing error when I apply lock
What is the error message?