Это видео недоступно.
Сожалеем об этом.

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

Комментарии • 23

  • @PratikChilkewar
    @PratikChilkewar 21 день назад +1

    very nice explain
    Thank you.

  • @syedmubeenhussain6317
    @syedmubeenhussain6317 Месяц назад +1

    nice

  • @ansarahmad1072
    @ansarahmad1072 Год назад +1

    Great Explanation You have solved my Headache

  • @aliasadhassan
    @aliasadhassan 7 месяцев назад +1

    Mostly interviews asked this ...on how you can make single pattern thread safe !!! BTW very nice ...God bless you

  • @user-wz1rx1hw7l
    @user-wz1rx1hw7l 11 месяцев назад +1

    Very comprehensively described !

  • @varunbhalla4901
    @varunbhalla4901 6 месяцев назад +1

    Nice and clear concept explanation thanks

  • @shagunagrawal3773
    @shagunagrawal3773 Год назад +1

    Great knowledge i appreciate you 🤗

  • @MrRana1478
    @MrRana1478 Год назад +1

    thanks Sir, Very well explained

  • @zeeluck7128
    @zeeluck7128 9 месяцев назад +1

    Excellent

  • @abdulkadir-jh2yj
    @abdulkadir-jh2yj Год назад +1

    Thank you so much for making video on pattern could you pls make on all patterns

    • @CodewithRSV
      @CodewithRSV  Год назад

      ruclips.net/p/PLmzGdRRZtjPfkKJroG4fHSKquN5AIpHw3

  • @RhymePlayKids
    @RhymePlayKids 7 месяцев назад +1

    Dose it require to make class as Sealed?

    • @CodewithRSV
      @CodewithRSV  7 месяцев назад +1

      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.

  • @manishgarg8371
    @manishgarg8371 6 месяцев назад +1

    Great explanation, Do you have video on Factory Patter as well ?

    • @CodewithRSV
      @CodewithRSV  6 месяцев назад

      ruclips.net/video/I2DbKwKHeUA/видео.html

  • @dipikabhagat5252
    @dipikabhagat5252 Год назад +1

    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?

    • @CodewithRSV
      @CodewithRSV  Год назад +1

      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.

    • @dipikabhagat5252
      @dipikabhagat5252 Год назад +1

      Thanks for the reply sir 👍

  • @pratikburade5221
    @pratikburade5221 Год назад

    Can you made tutorial on blazor with entity framework

  • @swapnilsonawane2525
    @swapnilsonawane2525 Год назад +1

    Is it the same way we create singleton class ?

    • @CodewithRSV
      @CodewithRSV  Год назад

      Yes, using singleton pattern and creating a Singleton class is same thing.

  • @deepalikhairnar4240
    @deepalikhairnar4240 10 месяцев назад +1

    It's showing error when I apply lock

    • @CodewithRSV
      @CodewithRSV  10 месяцев назад

      What is the error message?