@_instance ||= new @ arguments…
One could use the Singleton class directly but I like to extend it so that the Singleton class itself stays reusable.
class Registry extends Singleton
set: (key, val) ->
@properties[key] = val
get: (key) ->
registry = Registry.getInstance()
registry.set "ohai", "there"
console.log registry.get "ohai"