Repeatedly creating a new instance (for repeated lookups, etc.) is an anti-pattern because of the work done during initialization. Even if we use a cache, it's a pretty big hit to do this multiple times per request.
A singleton pattern (forcing use of a static get_instance() method by default) would work around this.
Repeatedly creating a new instance (for repeated lookups, etc.) is an anti-pattern because of the work done during initialization. Even if we use a cache, it's a pretty big hit to do this multiple times per request.
A singleton pattern (forcing use of a
static get_instance()
method by default) would work around this.