Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

this is exapmes of singleton pattern written in ruby.

  • Singleton_V1_class_variable
    • pro: easy to implement. instantiation when init, avoid the multi-thread synchronizing issue.
    • con: no lazy load, memory waste.

singleton pattern UML

You can’t perform that action at this time.