Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2025-01-08 이날의 게시글 #169

Open
refigo opened this issue Jan 8, 2025 · 0 comments
Open

2025-01-08 이날의 게시글 #169

refigo opened this issue Jan 8, 2025 · 0 comments

Comments

@refigo
Copy link
Owner

refigo commented Jan 8, 2025

이날의 게시글: [싱글톤 디자인패턴(Singleton Design), static과 타입프로퍼티(type Property)]

싱글톤 디자인 패턴은 하나의 인스턴스를 공유해 메모리를 절약하고 정보를 공유하는데 유용해. 그런데 구체 클래스에 의존하면 OCP와 DIP 위배할 수도 있고, 테스트가 어려울 수도 있어. 스위프트에서는 static 키워드로 싱글톤 구현하고, thread-safe하게 인스턴스 생성하고 공유할 수 있어. 주의할 점들을 잘 숙지하고 활용해봐!

https://80000coding.oopy.io/e9007ef5-e020-4a0f-84d2-129e4b5d3c6f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant