Backend

· Backend/Java
서론 Java의 학습을 위해, 미션 학습을 진행하고 있습니다. 첫번째 미션으로는 “숫자야구게임”을 진행해보려고 합니다. Step1부터 점진적으로 확장해 나가는것이 목표입니다. 가장 중요한건 확장가능한 설계와 도메인 모델 정의, 테스트 코드 작성을 통한 안정적인 애플리케이션 구현을 가지고 해당 미션을 진행해보려고 합니다. 의도적으로 꼼꼼한 테스트 코드와 원시값 포장을 진행하였습니다. 해당 부분은 참고해주시면 좋을거 같습니다. 미션 요구사항 숫자야구게임이란? 1부터 9까지 서로 다른 수로 이루어진 3자리의 수를 맞추는 게임입니다. 컴퓨터와 싸우는 게임으로 컴퓨터가 뽑은 랜덤의 숫자를 뽑을수 있도록 합니다. 상세 스펙 명령어 1을 입력하면 게임을 시작합니다. 9를 입력하면 애플리케이션을 종료합니다. 게임을 시..
· Backend/Java
서론 이번에 Java를 다시 학습을 목표로 미션을 만들어서 진행중에 있습니다. 그 첫번째 미션은 “숫자야구게임”을 현재 구현중에 있는데, 여기서 핵심적인 개념 중에 1~9까지의 숫자중에 중복되지 않는 3개의 숫자를 랜덤으로 뽑는 기능에 대해서 고민하던 중에 두가지 방법을 찾아 두가지 방법에 대해서 이야기를 해보려고 합니다. Collections.shuffle을 사용해서 subList로 3개의 값을 추출 Collections.shuffle() 은 리스트의 모든 요소를 랜덤으로 섞는 작업을 하는 메서드입니다. public static void shuffle(List list) { Random rnd = r; if (rnd == null) r = rnd = new Random(); // harmless rac..
서론 최근 회사에서 하나의 DB를 두개의 DB로 분리하는 멀티 DB의 적용을 진행하고 있습니다. 그 작업을 진행하면서 가장 먼저 한 작업한 일은 각각의 DB에 들어가 있는 테이블들이 FK로 연결되어 있는 부분을 체크하고 FK를 해제해야 하는 것을 해제 해야 하는 일이였습니다. 1번 DB에 A테이블, 2번 DB에 B 테이블이 있다고 했을때 A테이블에 B테이블의 FK가 있을 경우 2번 데이터베이스로 이전을 하지 못하며, 사실상 FK자체를 적용할수가 없다고 생각해주시면 좋을거 같습니다. FK(Foreign Key)란? 외래키라고 부르며, RDBMS에서 관계를 지정할때 사용합니다. FK를 사용하는 이유는 FK와 PK간의 일관성을 유지하기 위함입니다. 외래키 설정 방법은 아래와 같습니다.여기서 child_tabl..
💡 원본글 : https://thorben-janssen.com/implement-soft-delete-hibernate/ How to implement a soft delete with Hibernate Hibernate supports a set of annotations that allows you to implement a soft delete with minimal coding effort. thorben-janssen.com 일부 응용 프로그램에서는 데이터베이스에서 레코드를 영구적으로 삭제하고 싶지 않거나 삭제가 허용되지 않을 수 있습니다. 그러나 더 이상 활성 상태가 아닌 레코드를 삭제하거나 숨겨야 할 필요가 있습니다. 예를 들어, 여전히 사용 중인 다른 비즈니스 객체에 연결된 사용자 계정을..
💡 원본글 : https://towardsdev.com/data-transfer-object-dto-in-spring-boot-c00678cc5946 Data Transfer Object (DTO) in Spring Boot Explore the benefits of using Data Transfer Objects (DTOs) in Spring Boot, with examples including manual DTO creation, ModelMapper, and… towardsdev.com 이 글에서는 Spring Boot에서 데이터 전송 객체(DTO)의 이점을 탐구하며, 수동 DTO 생성, ModelMapper, Lombok을 포함한 예제들을 살펴볼 것입니다. Photo by Joshua Sorti..
💡 원본 글 : https://blog.appsignal.com/2021/07/07/general-ruby-on-rails-problems-and-takeaways.html General Ruby on Rails Problems and Takeaways | AppSignal Blog In this last part of the Rails Patterns and Anti-patterns series, I'll be going over the most common problems I've encountered while building and shipping Ruby on Rails applications. blog.appsignal.com Ruby On Rails 패턴 및 안티 패턴 시리즈 마지막 파트에 ..
💡 원본글 : https://blog.appsignal.com/2021/04/14/ruby-on-rails-controller-patterns-and-anti-patterns.html Ruby on Rails Controller Patterns and Anti-patterns | AppSignal Blog In this part of the series on Rails patterns and anti-patterns, we are going to analyze the final part of the MVC (Model-View-Controller) design pattern — the Controller. blog.appsignal.com Ruby On Rails 패턴 및 안티 패턴 시리즈의 네 번째 편..
💡 원본글 : https://blog.appsignal.com/2021/02/10/ruby-on-rails-view-patterns-and-anti-patterns.html Ruby on Rails View Patterns and Anti-patterns | AppSignal Blog Rails views are sometimes amazing and fast, and at other times, they can have all sorts of issues. If you want to increase confidence over how you handle your views, then this blog post is for you. blog.appsignal.com Ruby On Rails 패턴과 안티패..
💡 원본글 : https://blog.appsignal.com/2020/11/18/rails-model-patterns-and-anti-patterns.html Ruby on Rails Model Patterns and Anti-patterns | AppSignal Blog If you're struggling with models, this blog post is for you. We will quickly go through the process of putting your models on a diet and finish strongly with some things to avoid when writing migrations. blog.appsignal.com Ruby on Rails 패턴 및 안티..
💡 원본 글: https://blog.appsignal.com/2020/08/05/introduction-to-ruby-on-rails-patterns-and-anti-patterns.html Introduction to Ruby on Rails Patterns and Anti-patterns | AppSignal Blog Dig into the basics of design patterns and anti-patterns. blog.appsignal.com Ruby On Rails 패턴 및 안티패턴 시리즈의 첫 번째 게시물에 오신 것을 환영합니다. 이 시리즈에서는 Rails 앱을 개발하는 동안 접할 수 있는 모든 종류의 패턴에 대해 자세히 살펴보겠습니다. 오늘 우리는 (디자인) 패턴이 무엇인지 보여주고..
Seyun(Marco)
'Backend' 카테고리의 글 목록 (2 Page)