마틴 파울러
-
엔터프라이즈 애플리케이션 아키텍처 패턴 3 - 데이터 전송 객체, 기본 패턴책책책 책을 읽읍시다/프로그래밍 2023. 3. 14. 23:43
15장. 분산 패턴 - 데이터 전송 객체 메서드 호출 횟수를 줄이기 위해 프로세스 간에 데이터를 전송하는 객체이다. 원격 파사드와 같은 원격 인터페이스를 사용할 때는 각 호출의 비용이 상당히 부담스럽다. 따라서 호출 횟수를 줄여야 하며, 이를 위해서는 각 호출에서 더 많은 데이터를 전송해야 한다. 한 가지 방법은 다수의 매개변수를 사용하는 것이다. 그러나 이 방식은 프로그램을 작성하기에는 상당히 불편하며, 자바와 같이 단일 값만 반환할 수 있는 언어에서는 아예 불가능하다. 이 문제를 해결하는 방법은 호출에 필요한 모든 데이터를 저장하는 데이터 전송 객체(Data Transfer Object)를 만들어 사용하는 것이다. 데이터 전송 객체는 직렬화가 가능해야 연결을 통해 전송할 수 있다. 일반적으로 데이터 ..
-
엔터프라이즈 애플리케이션 아키텍처 패턴 2 - 객체&관계형 매핑, 리포지토리, 프런트 컨트롤러책책책 책을 읽읍시다/프로그래밍 2023. 3. 13. 23:48
12장 객체-관계형 구조 패턴 : 식별자 필드 관계형 데이터베이스는 행을 다른 행과 구분하기 위해 기본 키라고 하는 키를 사용한다. 그러나 객체 시스템은 내부적으로 올바른 식별자를 보장하므로 인메모리 객체에는 이러한 키가 필요없다(C++의 경우 원시 메모리 위치를 활용함). 데이터베이스에서 데이터를 읽는 것은 간단하지만 데이터를 다시 기록하려면 데이터베이스와 인메모리 객체 시스템을 연결해야 한다. 식별자 필드(Identity Field)는 기본적으로 놀라울 만큼 단순하다. 관계형 데이터베이스의 기본 키를 객체의 필드에 저장하는 것이 전부다. 식별자 필드의 기본 개념은 아주 간단하지만 상당히 많은 복잡한 사항이 연관돼 있다. 키 선택 : 첫 번째 문제는 데이터베이스에 있는 어떤 종류의 키를 선택하느냐다. ..
-
엔터프라이즈 애플리케이션 아키텍처 패턴 1 - 계층 구조책책책 책을 읽읍시다/프로그래밍 2023. 3. 12. 01:31
저자 : 마틴 파울러 옮긴이 : 최민석 들어가며 흔히 접하는 디자인 패턴이 프로젝트의 수많은 코드 중 특정 문제를 다루기 위한 것이라면 이 책에 나오는 패턴들은 그보다 광범위하게 애플리케이션의 전반적인 문제를 다룬다. 전자의 해결 대상은 나무이고 후자의 것은 숲이다. 그리고 여기서 고민한 패턴들 대부분이 현재에는 프레임워크에 녹여져 있다. 초반부 내용은 JPA와 이를 구현한 Hibernate같은 ORM 기술에 적용되어 있고, 중반부는 MVC 프레임워크에서 찾아볼 수 있다. 지금으로서는 당연한 기술이지만 당시에 치열하게 반복 작업을 줄이려는 노력과 추상화에 힘쓴 덕분에 이렇게 편리하게 개발할 수 있지 않나 싶다. 내용을 하나하나 정리하기에는 비슷한 내용이 많고, 저수준의 프레임워크적인 내용이라 현재도 잘 ..