SlideShare a Scribd company logo
1 of 20
Domain-Driven Design
Quickly 読書メモ
2.ユビキタス言語
すごく・・・akimicyuです・・・
Quicklyの目次
はじめに
イントロダクション
1.ドメイン駆動設計とは何か
2.ユビキタス言語
3.モデル駆動設計
4.リファクタリングのためのさらに深い考察
5.モデルの完全性を維持する
6.今日におけるDDDの諸問題
2
背景(1章を踏まえて)
DDDを実践するには?(1/2)
• 「ソフトウェアの専門家」と「ドメインの専門家」
が協力してドメインモデルを作成することが不可欠
• それを阻む「言語の壁」
• プログラムの言葉(クラス、メソッド、アルゴリ
ズム、パターン、……)
• 専門領域の言葉(部外者には理解できない)
4
DDDを実践するには?(2/2)
• チームのメンバがドメインについて議論する共通の
言葉を共有していない(両者、好き勝手な言葉を使
用)と、プロジェクトが深刻な問題に直面する
• DDDの核となる原則
• ドメインモデルに基づく言語(→ユビキタス言語
)を使うこと
5
ユビキタス言語
ユビキタス言語(1/2)
• ドメインモデル(->1章)に基づく言語
• ドメインモデルはソフトウェアとドメインが出会う場所に
あるのだから、共通言語の基板として適切
• チームのメンバに、常にこの言語を用いるよう要求
1. ステークホルダ間でのコミュニケーション
2. 設計文書/図
3. コード記述時の命名等
7
ユビキタス言語(2/2)
• ユビキタス言語を用いることで設計の全ての部分が
結びつき、設計チームが効率よく作業するための前
提が生まれる
• ドメイン専門家の注意点:ドメインの表現としてふ
さわしくない用語/モデル構造に反対すること
• ソフトウェア専門家の注意点:設計に紛れ込みやす
い曖昧さや矛盾が現れていないか注視すること
8
ユビキタス言語を創造する
(航空監視プロジェクトの例)
出発点:飛行機、出発地、目的地
10
ユビキタス言語を創造する(1/6)
専門家 : 基本的なことから始めましょう。どのような飛行
機を監視するにせよ 監視対象の飛行機は必ず存在します。
それぞれの飛行機は出発地から飛び立ち、 目的地に到着し
ます。
ユビキタス言語を創造する(2/6)
「航路」の概念が発見される!
開発者 : なるほど、簡単ですね。飛行
しているときに、パイロットは好きな
進 路を選ぶことができるのですか。目
的地に着くのであれば、どの方向へ進
むの かは自分たちの責任で決めてしま
っていいのですか。
専門家 : いいえ、それは違います。パ
イロットには飛ばなければならない航
路 が指示されます。パイロットは可能
な限り、航路に沿って飛行しなければ
なり ません。
ユビキタス言語を創造する(3/6)
「航路」を形成する地球平面上の点を「運航定点」と定義
(出発地/目的地は「運航定点」の一種とする)
開発者 : わかりました。ではそのよう
な経度と緯度で決まる点を運行定点と
呼 びましょう。地球上の固定された点
ですからね。それから、航路は2次元
の点 の連なりとして考えましょう。と
すると、出発地も目的地も運行定点で
すから、 特別な概念として考えなくて
もよさそうです。
ユビキタス言語を創造する(4/6)
高度の必要性に疑問を持つことから「運行計画」の概念を
発見する!
開発者 : ところで、飛 行機が航路に沿
って飛ばなければならないのはわかり
ましたが、高いところを 飛んだり低い
ところを飛んだりするのは自由にでき
るのですか。
専門家 : いいえ。飛行機が飛んでいる
間に維持すべき高度も運行計画によっ
て 事前に決められています。
ユビキタス言語を創造する(5/6)
「運行計画」に気づくことで、システムの監視対象が「飛
行機」ではなく「フライト」であることへの気づきを得る
開発者 : この図のおかげで、気づいたこと
が あります。運行を監視しているときは
、じつは飛行機そのものに関心があるの
ではない、機体の色が白だろうと青だろう
と、機種がボーイングだろうとエア バス
だろうと関係ないということです。関心が
あるのはその飛行機のフライト なのです
。実際に追跡し、計測するのはフライトな
のです。モデルをもっと正 確にするため
に尐し変更する必要がありますね。
ユビキタス言語を創造する(6/6)
• とはいえ、先のような対話は冗長で困難。チームの
メンバ全てが共通言語の必要性を自覚し、ユビキタ
ス言語を使うよう徹底されていないと実践は難しい
• 開発者はユビキタス言語で表現された、ドメインモ
デルの主要概念をコードに実装すべき(共通言語と
コードの対応付け)
• 実際にどのように行うかについては、3章参照
15
ユビキタス言語の
表現方法
ユビキタス言語の表現方法
• チームのメンバに設計上の概念を伝える上で適切な
方法であるなら何でもいい(図、文章、口頭の会話
、コード、……)
• UMLはスケッチ用途には有用だが万能ではない
• 各種方法のトレードオフを意識すること。その際に
は、伝達効率だけでなく保守コストも意識すること
17
まとめ
まとめ
• ドメインの専門家と協力してドメインモデルを作成
すること
• そのためには、ドメインモデルに基づく共通言語で
あるユビキタス言語を用いることを意識し、チーム
内で徹底すること
• ユビキタス言語の表現方法については、他のステー
クホルダが理解可能なものを選択すること
19
ご静聴ありがとうございました

More Related Content

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Domain Driven Design(ドメイン駆動設計) Quickly 読書メモ: 2.ユビキタス言語