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

Flyweight pattern #22

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Flyweight pattern #22

wants to merge 2 commits into from

Conversation

toneyparky
Copy link
Collaborator

Flyweight Pattern

한마디로 캐시
자바의 Integer 클래스가 일정한 개수만큼 캐싱해두는데 요거랑 비슷하다는 생각이 드네~

Note

일반적으로는 잘 사용하지 않을 것 같아. Enum 이 있는걸... 예시처럼 무거운 데이터를 매번 인스턴스화하고 싶지 않을 때에 사용할법한데, 지금까지 그런 케이스는 없었다..!

@toneyparky toneyparky requested review from kkoon9 and mog-hi July 18, 2024 12:36
@toneyparky toneyparky self-assigned this Jul 18, 2024
Copy link
Member

@mog-hi mog-hi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Integer 클래스가 일정한 개수만큼 캐싱 이거는 몰랐네! 감사용~
진짜 요 패턴은 언제 활용해야될지 모르겠다🧐
수고했어!!

@toneyparky
Copy link
Collaborator Author

Integer 클래스가 일정한 개수만큼 캐싱 이거는 몰랐네! 감사용~ 진짜 요 패턴은 언제 활용해야될지 모르겠다🧐 수고했어!!

이번에 interpreter 패턴에서 이 패턴을 활용하기도 한다는고만! 근데 interpreter 패턴 자체도 언제 쓰일지 몰라서 결국엔 잘 안쓸듯 .. ㅋㅋㅋ

Copy link
Collaborator

@kkoon9 kkoon9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

바빠서 넘 늦게 확인했다... 고생했삼 승완

@kkoon9
Copy link
Collaborator

kkoon9 commented Aug 13, 2024

추가로 멘토링 자료 만들면서 야구게임 만들고 있는데 1~9를 가지는 객체도 Flyweight pattern으로 미리 만들어놓으면 괜찮겠다 생각이 드네!

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

Successfully merging this pull request may close these issues.

4 participants