개요
A domain model is not a particular diagram; it is the idea that the diagram is intended to convey. It is not just the knowledge in a domain expert’s head; it is a rigorously organized and selective abstraction of that knowledge.
도메인 모델이란 실질적인 다이어그램이 아니라 전달해야할 추상적인 다이어그램이다. 단지 도메인 전문가의 머릿속 지식에 그칠뿐만 아니라 엄격하게 "조직화"되고 "선별된" 지식이다.
Knowledge Crunching
효과적인 domain 모델러는 지식을 잘 쪼개는 사람이다. Knowledge Crunching은 혼자하는 일이 아니다. 개발팀과 도메인 전문가가 협동하여 해야하며 주로 개발자들로부터 주도되어야 한다. 과거의 waterfall 모델에서는 비즈니스 전문가가 분석가를 통해 프로그래머와 소통하였다. 이 접근은 feedback의 부재로 인해 무조건 실패한다. 왜냐하면 모델수립의 모든 책임을 갖고 있는 분석가는 비즈니스 전문가로부터 input을 받고 개발 프로그래머로부터 지난 과거의 피드백을 받지 않거나, 배우려고 하지 않기 때문이다.
개발자들은 청사진에 대해 표현하는 것에 전문적이어야 한다. 그 것으로 통해 다음작업에 대해서 알리고, 결과를 보여줄 수 있다. 만약 프로그래머가 domain에 관심이 없다면 원리를 배우지는 않고 단지 어플리케이션 기능만 구현하게 된다.
뛰어난 프로그래머는 당연히 추상화(abstract) 와 모델을 개발할수 있어야 한다.
도메인 모델에 대한 지속적인 정제활동은 개발자들에게 해당 비즈니스의 원리를 배우도록 강제한다. 도메인전문가들은 종종 그들이 필수적으로 알고 있는 것들과 소프트웨어 프로젝트가 요구하는 개념적인 필수요소를 이해하면서 정제활동을 하곤한다.
모델이 발전하면서 프로젝트 전반에 걸쳐 생산되는 정보를 결합시켜주는 좋은 툴이 될것이다.
Continuous Learning
도메인은 높은 기술력이 필요한것은 아니다 보니 우리는 얼마나 많은 것을 우리가 모르는지 깨닫지 못한다. 이런 무지를 방치하게 되면 우리는 추정을 실패할 확률이 높다.
Knowledge-Rich Design
도메인 전문가는 얼마나 복잡한 정신적 과정을 거치는지, 비즈니스 룰을 얼마나 분석하는지, 모순을 조화시키는지 알지못하는 경우가 있다. 소프트웨어 자체는 이것을 할 수 없고 이것은 소프트웨어 전문가와 긴밀한 협력속에서 Knowledge Crunching을 하면서 깨닫게 되는 것이다.
Deep Models
유용한 모델은 쉽게 도출되지 않는다. 우리는 도메인과 어플리케이션 요구사항을 이해하면서 초반에 중요해보였으나 후에 피상적으로 보이는 모델 요소는 버린다. 문제점을 관통하는 미묘한 추상적 개념은 쉽게 나오지않는다. 예를들어 수하물이동시스템의 경우 수하물이 이동하는 것으로 초기에 파악되지만 Knowledge Crunching을 하다보면 엔티티에서 다른 엔티티로 수하물에 대한 책임을 옮기는 일이었다.
Domain Driven Design Model 선정에 있어 3가지 고려사항
1. The model and the heart of the design shape each other : 모델과 디자인 Core는 상호간 형태를 결정한다. 이러한 Model과 이행의 결합은 유지관리와 지속적인 개발을 효과적으로 할수 있도록 돕는다. 왜냐면 Code는 모델을 이해하면서 해석하기 쉽기 때문이다.
2. The model is the backbone of a language used by all team members : 모델은 모든 팀 멤버가 사용하는 언어의 중추이다. 유비쿼터스한 언어로 소통해야 개발자와 도메인 담당자간 원활한 소통이 가능해진다.
3. The model is distilled knowledge : 모델은 정제된 지식이다. 모델은 팀원이 동의한 구조로 도메인을 나누고 요소를 식별한다. 이렇게 사전 공유된 지식은 개발자와 도메인 담당자간 협업에 이바지한다.
Ingredients of Effective Modeling (효과적인 Modeling의 구성요소)
1. Binding the model and the implementation : 모델과 이행을 결합시켜라
간략한 프로토타입이라도 필수적인 연결을 조기에 구축한다. 이것은 모든 후속반복작업에 의해 유지관리 된다.
That crude prototype forged the essential link early, and it was maintained through all subsequent iterations.
2. Cultivating a language based on the model : 모델에 기반하여 언어를 만들어가야 한다.
누군가의 번역(해설)이 없더라도 모호하지 않게 이해가 되는 언어를 찾아가야 한다.
At first, the engineers had to explain elementary PCB issues to me, and I had to explain what a class diagram meant. But as the project proceeded, any of us could take terms straight out of the model, organize them into sentences consistent with the structure of the model, and be unambiguously understood without translation.
3. Developing a knowledge-rich model : 지식이 풍부한 모델을 개발시켜라
모델은 단순 데이터 스키마가 아니라 행위와 Rule을 갖고 있다. 다양한 종류의 지식을 담아내고 있다.
The objects had behavior and enforced rules. The model wasn’t just a data schema; it was integral to solving a complex problem. It captured knowledge of various kinds.
4. Distilling the model : 모델을 정제하라
중요한 개념은 모델을 더 완벽하게 만들기 위해 추가되지만, 유용하거나 중요하지 않은 개념은 제거한다
Important concepts were added to the model as it became more complete, but equally important, concepts were dropped when they didn’t prove useful or central. When an unneeded concept was tied to one that was needed, a new model was found that distinguished the essential concept so that the other could be dropped.
5. Brainstorming and experimenting : 브레인 스토밍과 실험을 하라
대상에 대한 스케치와 브레인스토밍 자세는 모델에 대한 실험적인 시간(수없이 많은 훈련, 시도, 판단)으로 바꿀수 있다.
The language, combined with sketches and a brainstorming attitude, turned our discussions into laboratories of the model, in which hundreds of experimental variations could be exercised, tried, and judged. As the team went through scenarios, the spoken expressions themselves provided a quick viability test of a proposed model, as the ear could quickly detect either the clarity and ease or the awkwardness of expression.
'Programming > MSA' 카테고리의 다른 글
Domain Driven Design/Eric Evance - 3. Binding Model and Implementation (0) | 2022.07.19 |
---|---|
Domain Driven Design/Eric Evance - 2. Communication and the Use of Language (0) | 2022.07.19 |
CQRS 패턴이란 (0) | 2022.07.06 |
MSA에 대한 기본개념 - 5. 회복성 (0) | 2022.06.12 |
MSA에 대한 기본개념 - 4. 서비스를 나눈뒤 상호참조, 통합 (0) | 2022.06.12 |