Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 |
Tags
- 코딩
- adb logcat
- arm trust zone 강의
- 보안강의
- ARM Trustzone 설명
- ARM Trust Zone
- ARM Trustzone
- 반고
- 면접
- 주식선택기준
- 캠핑장
- 텐트
- threadtime
- 아웃웰
- 중고텐트
- 에어텐트
- 개발자
- ARM trustzone 내용
- android log
- nft
- 프로그래밍
- setns
- 언어치료
- 개발자면접
- arm trustzone 강의
- 캠핑
- 초캠중고
- 프로그래머면접
- 프로그래머
- 게임 NFT
Archives
- Today
- Total
콩딱일상
도메인 모델 패턴 본문
복잡한 비즈니스 로직과 데이터 처리를 효과적으로 관리하기 위한 방법을 찾는 과정에서 비롯되었다.
모든 비즈니스 로직을 서비스 레이어 한곳에 구현하면 가독성이 떨어지고 유지보수하기 어려워지는 한계점이 나오게 된다.
서비스 레이어와 비즈니스 규칙 예
public class XXService {
public void addItem(String id, String productNo, String productName, int quantity) {
int size = Dao.selectItemSize(id);
if (size > 10) {
throw new RuntimeException("...");
}
...
}
}
도메인 모델 패턴
- 데이터와 행위를 하나의 객체로 설계
public class XXService {
public void addItem(String id, String productNo, String productName,
int quantity) {
XX xx = Dao.select(id);
xx.addItem(productNo, productName, quantity);
Dao.update(xx);
}
}
public class XX {
public void addItem(String productNo, String productName, int quantity) {
//
}
}