Skip to content

Proposal: Add “Generic Lazy-Holder Singleton Registry” Design Pattern (Hybrid Singleton Factory + Initialization-on-Demand Holder Idiom) #3399

@Hari-099

Description

@Hari-099

I would like to contribute a new design pattern to the repository:
Generic Lazy-Holder Singleton Registry Pattern — a hybrid design combining:

1. Initialization-on-demand holder idiom (best-practice JVM lazy-loading singleton)

2. Generic Singleton Factory / Multiton Registry (one singleton instance per class)

3. Reflection-safe instance creation

4. Concurrent, thread-safe instance registry using computeIfAbsent

This pattern provides a type-safe, lazy-loaded, per-class singleton registry that does not require external frameworks (like Spring) and works purely through Java language mechanisms.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions