Design patterns Monostate

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Remarks

As a side note, a few advantages of the Monostate pattern over the Singleton:

  • There is no 'instance` method to be able to access an instance of the class.
  • A Singleton does not conform to the Java beans notation, but a Monostate does.
  • Lifetime of instances can be controlled.
  • Users of the Monostate don't know that they are using a Monostate.
  • Polymorphism is possible.


Got any Design patterns Question?