Skip to content

굳이 Eager Loading을 하는 이유가 있을까요? #5

@koreanNomadDevs

Description

@koreanNomadDevs

아래의 소스에서

private static Coin instance = new Coin(); // Eagerly Loading of singleton instance

굳이 Eager Loading을 하는 이유가 있을까요?

getInstance() 메소드 내에서 Coin instance가 null 인지 체크 후 null일때만 인스턴스를 만드는 것이 좋을 것 같습니다.

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