Post

2023-02-18-TIL

2023-02-18-TIL

Singleton Pattern

객체의 생명주기를 정확히 알고있고, 관리해줄 수 있는 주체가 명확할 때는 스프링처럼 싱글턴 패턴을 사용하면 효율적으로 메모리 관리를 할 수 있다고 생각한다. 싱글턴 패턴은 테스트 하기 어렵고, 멀티 스레드 환경에서 제어하기 어려우므로 직접사용하는 것은 지양하는 것이 좋을 것 같다.

  • https://velog.io/@jaeeunxo1/spring-singleton
  • https://www.geeksforgeeks.org/java-singleton-design-pattern-practices-examples/
  • https://www.digitalocean.com/community/tutorials/thread-safety-in-java-singleton-classes
  • https://www.benchresources.net/how-to-construct-a-singleton-class-in-a-multi-threaded-environment-in-java/
  • https://medium.com/@cancerian0684/singleton-design-pattern-and-how-to-make-it-thread-safe-b207c0e7e368

Immutablity vs Siingleton

  • https://stackoverflow.com/questions/38606181/does-immutability-and-singleton-solves-the-same-purpose
  • https://javasearch.buggybread.com/InterviewQuestions/questionSearch.php?searchOption=question&keyword=3679

Adapter Pattern

역으로 다른 부분을 변경하고 싶을 때 적용할 수도 있을 것 같다. 예를 들어, DB를 변경하고 싶은데, 서비스 코드가 DB구현에 의존하고 있을 때 어댑터 패턴을 적용해서 상호호환 가능하도록 할 수 있다.

JPA dialect도 어댑터 패턴이 포함되어있지 않을까?

K의 경우, 웹 푸시알림을 어떤 기능에서 하나는 보내고 하나는 안 보내는 식으로 구현하기도 한다.

DDEX라는 음원 입수 규격이 있는데, 유통사마다 버전을 달리하고 있는게 많아서, 상호호환이 되도록 어댑터 패턴을 적용해보는 것도 좋을 것 같다.

  • https://refactoring.guru/ko/design-patterns/adapter/java/example
  • https://medium.com/swlh/adapter-pattern-what-it-is-and-how-to-use-it-83e35a02e7f9
  • https://www.csanim.com/design-patterns/adapter-design-pattern-illustration-and-code
  • https://www.devmaking.com/learn/design-patterns/adapter-pattern/
  • https://www.geeksforgeeks.org/adapter-pattern/
  • https://sourcemaking.com/design_patterns/adapter
  • https://garywoodfine.com/the-adapter-pattern/
  • https://stackify.com/design-patterns-explained-adapter-pattern-with-code-examples/
  • https://doohyun.tistory.com/74
  • https://parkgaebung.tistory.com/69
  • https://dev-youngjun.tistory.com/235?category=937057
  • https://stackoverflow.com/questions/11079605/adapter-any-real-example-of-adapter-pattern
  • https://www.digitalocean.com/community/tutorials/adapter-design-pattern-java
  • https://stacktraceguru.com/adapter-design-pattern/
  • https://medium.com/@zieunv/design-pattern-adapter-pattern-78706d7df304
  • https://developer.apple.com/documentation/sign_in_with_apple/generate_and_validate_tokens
  • https://theswiftdev.com/swift-adapter-design-pattern/
  • https://www.baeldung.com/java-adapter-pattern
  • https://github.com/iluwatar/java-design-patterns/issues/628
  • https://roytuts.com/adapter-design-pattern-in-java/

Spring Data JPA findAll is Anti-Pattern?

  • https://vladmihalcea.com/spring-data-findall-anti-pattern/

Package Arrangement and Clean Architecture

  • https://www.youtube.com/watch?v=5OjqD-ow8GE
  • https://www.youtube.com/watch?v=FUgIKnzvU3g
  • https://www.youtube.com/watch?v=2dKZ-dWaCiU
  • https://www.youtube.com/watch?v=jVyA5DV6r8w
  • https://www.youtube.com/watch?v=7EmboKQH8lM&list=PLmmYSbUCWJ4x1GO839azG_BBw8rkh-zOj
  • https://www.youtube.com/watch?v=dK4Yb6-LxAk
  • https://www.youtube.com/watch?v=Ys_W6MyWOCw
  • https://www.youtube.com/watch?v=_jDNAf3CzeY
  • https://www.youtube.com/watch?v=SxJPQ5qXisw
  • https://www.youtube.com/watch?v=EGzQvBqhUS0
  • https://www.youtube.com/watch?v=PzEox3szeRc&t=1s
  • https://codeopinion.com/clean-architecture-example-breakdown/
  • https://github.com/mattia-battiston/clean-architecture-example#building-and-running-the-application
  • https://betterprogramming.pub/the-clean-architecture-beginners-guide-e4b7058c1165
  • https://www.baeldung.com/spring-boot-clean-architecture
  • https://dev.to/dyarleniber/hexagonal-architecture-and-clean-architecture-with-examples-48oi
  • https://medium.com/codex/clean-architecture-for-dummies-df6561d42c94
  • https://www.gregorypacheco.com.br/posts/differences-between-clean-architecture-and-hexagonal-architecture-cshrp-dot-net.html
  • https://haandol.github.io/2022/02/13/demystifying-hexgagonal-architecture.html
  • https://medium.com/codex/clean-architecture-for-dummies-df6561d42c94
  • https://dataportal.kr/74
  • https://medium.com/omarelgabrys-blog/component-based-architecture-3c3c23c7e348
  • https://medium.com/omarelgabrys-blog/component-based-architecture-3c3c23c7e348
  • https://files.gotocon.com/uploads/slides/conference_12/515/original/gotoberlin2018-modular-monoliths.pdf
  • https://phauer.com/2020/package-by-feature/
  • https://www.techyourchance.com/popular-package-structures/
  • https://developer.adobe.com/commerce/php/development/package/component/
  • https://proandroiddev.com/package-by-type-by-layer-by-feature-vs-package-by-layered-feature-e59921a4dffa
  • https://learning-notes.mistermicheels.com/architecture-design/reference-architectures/package-by-feature-or-component/
  • https://github.com/pablxomedeiross/package-by-component-sample/tree/develop/notification
  • https://dzone.com/articles/package-component-and
  • https://blog.ttulka.com/package-by-component-with-clean-modules-in-java/
  • https://github.com/ttulka/blog-code-samples/tree/master/myshop
  • https://github.com/ttulka/ddd-example-ecommerce/tree/main/src/main/java/com/ttulka/ecommerce/warehouse
This post is licensed under CC BY 4.0 by the author.