Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^3: Caching a default instance to avoid initializing it every time (with Moo)

by Eily (Prior)
on Feb 09, 2018 at 10:52 UTC ( #1208809=note: print w/replies, xml ) Need Help??


in reply to Re^2: Caching a default instance to avoid initializing it every time (with Moo)
in thread Caching a default instance to avoid initializing it every time (with Moo)

You'd still have to write a wrapper if you want a single interface to sometimes provide a new instance, sometimes the singleton. But I like that this interface leaves the choice to the caller, you can either have a new instance, regardless of input, or the singleton when you know it can work.

  • Comment on Re^3: Caching a default instance to avoid initializing it every time (with Moo)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1208809]
help
Chatterbox?
Tanktalus has to figure out why his cb talker isn't working :(
[choroba]: https?
[choroba]: That was at least why my cb talker wasn't working.
[Tanktalus]: curious, then, why the reader works :)
[Tanktalus]: or posting the last hour of cb... well, maybe I should double check that first :)

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2018-07-15 21:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (326 votes). Check out past polls.

    Notices?