0% found this document useful (0 votes)
8 views69 pages

1 Understanding+the+Domain

Understanding DDD concepts.

Uploaded by

timmy burn
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views69 pages

1 Understanding+the+Domain

Understanding DDD concepts.

Uploaded by

timmy burn
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 69

Course: Domain Driven Design & Microservices for Architects

Section: Understanding the Domain

http://acloudfan.com/

Pragmatic Paths Inc © 2021

Contact: [email protected]

Discount Link to course:


https://www.udemy.com/course/domain-driven-design-and-microservices/?referralCode=C5DCD3C4CC0F0298EC1A
www.ACloudFan.com
Understanding the Domain
Terminology

*
1 What is a domain?

2 Domain experts?

3 Intro to ACME Travels


English Language definition of Domain

A sphere of knowledge, influence, or activity

www.ACloudFan.com
Business perspective of Domain

A field | industry in which the business operate

Banking Oil & Gas Retail … …

www.ACloudFan.com
Technology perspective of Domain

Represents the problem space

eCommerce User Experience | Front End

Business
Data
Layer
eCommerce Logic | Rules | Flow

Gateway Adapters Interfaces


www.ACloudFan.com
Software perspective of Domain

Represents the problem space

Media Resource
eCommerce Social Media
Streaming Planning

www.ACloudFan.com
Sub-Domains

Each domain consists of Sub-Domains

Banking

Loans Retail Merchant



Accounts Accounts Accounts

www.ACloudFan.com
Domain Experts a.k.a. Subject Matter Experts or SME

Thorough understanding of the domain

Banking
Accounts Expert

www.ACloudFan.com
Domain Experts a.k.a. Subject Matter Experts or SME

NO one expert knows everything about the domain !!!

Banking

Retail Accounts Expert Merchant Accounts Expert

Loans Accounts Expert


www.ACloudFan.com Compliance & Regulatory
ACME Travel Travel & Leisure industry

Travel Advisor

www.ACloudFan.com
ACME Travel There are multiple experts within a domain !!!

Travel Advisor Partner Contracts

Accounts
Customer Support ……

www.ACloudFan.com
Quick Exercise

What domain are you in?

Subdomains within that domain?

List out the domain experts you work with?


www.ACloudFan.com
Quick Review

Domain = A sphere of knowledge, influence, or activity

• Made up of MULTIPLE Sub-domains

• Multiple Domain Experts needed to support business functions


Architecture & Design
Understanding the idea behind modeling

*
1 Conceptual Models

2 Architectural Models

3 Architecture Vs. Design

www.ACloudFan.com
Conceptual Models

A representation of a system made from


composition of concepts

208 HP
14 Gallon tank
70 kWH battery
Objective of Conceptual Models

1. Enhance the understanding of the designers

2. Conveying the ideas to stakeholders

3. Provide a point of reference to create detailed specifications

4. Documentation for future reference

208 HP
14 Gallon tank
70 kWH battery
Software : Conceptual Models

Common terminology for the domain concepts

Identifies different parts of the system

Relationships between the concepts

Critical | Foundational parameters are defined

Architectural Model

Visualization of the system represented by the model


Architectural Model a.k.a. architecture

Structured representation of a solution that


meets the requirements in the problem space

• High level abstraction of parts of the end solution

• Presents a view of how the requirements will be met

• Assist in answering the questions posed by different stakeholders

www.ACloudFan.com
Architecture Vs. Design

Difference is in the level of details & focus

• Architecture = High Level | Skeleton | Long term focus

• Design = Relatively detailed | Focus on implementation

www.ACloudFan.com
Architecture & Design for a Rideshare System

www.ACloudFan.com
Drivers & Customers - Mobile Phones

10K Messages/Sec 500 Calls/Sec

Location Streams API Layer

5K Rides/Hour

Notification System
Driver
100 K Customer Ride Request Processor
Active Users Tracker
Geo Spatial Services

Customer Data
2 TB / Year Ride Data Payment Transactions
Driver Data
www.ACloudFan.com
Quick Exercise

Think about the design

www.ACloudFan.com
Drivers & Customers - Mobile Phones

10K Messages/Sec 500 Calls/Sec

Location Streams API Layer

5K Rides/Hour

Ride Request Processor Notification


Driver System
100 K
Customer
Active Users
Tracker
Geo Spatial
Services

2 TB / Year Customer Data Payment


Ride Data
Driver Data Transactions

www.ACloudFan.com
Quick Review

Conceptual Model = A set of concepts & their relationships

Architectural Model = A structured representation of a solution

Design = A structured representation of a solution that is closer to


the implementation
Modelling & Architecture style
Common Modeling Techniques and Architectural Styles

*
1 Modelling techniques

2 Architectural Styles

3 Intro to Domain Driven Design

www.ACloudFan.com
Model Diagrams

Multiple ways of modelling

• Purpose

• Perspective | Viewpoint

• Level of Details

www.ACloudFan.com
Models are NOT mutually exclusive i.e.; you may create multiple models for the same system
4+1 Architectural View Model

www.ACloudFan.com
4 +1 Architectural View Model

Describe the architecture from viewpoints of multiple


stakeholders

Logical View Development View

Object Oriented Decomposition Modules, Sub systems


Scenarios

Process View +1
(Requirements)
Physical View

Workflow, Interactions Servers, Database design

www.ACloudFan.com
Stakeholder Interests | Concerns

Architect

Executives Developer

www.ACloudFan.com
Business Expert
Network Engineer
Quick Exercise

List out the stakeholders in your organization

www.ACloudFan.com
http://www.omg.org/uml

www.ACloudFan.com
Please go through basic UML notation & diagrams on your own
http://www.omg.org/uml

A standard set of diagrams

A standard set of notations

www.ACloudFan.com
Please go through basic UML notation & diagrams on your own
A standard set of diagrams (14)

http://www.omg.org/uml

State Component
diagram diagram

Class Package
diagram diagram

Sequence
diagram Deployment
diagram
Activity Use Case
diagram diagram

www.ACloudFan.com
Software Architecture Styles

Reusable architectural pattern which may be


used as a solution to a commonly occurring
problem

www.ACloudFan.com
Architectural Styles

Categorized based on the Key Focus Area

• Service Oriented Architecture (SOA)


Communication
• Message Bus Architecture

• Layered architectures
Structure
• Object Oriented Architecture & Design

www.ACloudFan.com
Architectural Styles

Categorized based on the Key Focus Area

• Client Servers
Deployment
• 3 Tier Architecture

• Database Centric Design


Data
• Data Flow Diagrams

www.ACloudFan.com
Architectural Styles

Categorized based on the Key Focus Area

Domain • Domain Driven Design

Focus is on Business Domain rather than technology

www.ACloudFan.com
Data Centric Architecture

Focus is on core data in the domain

Develops
Software Team

www.ACloudFan.com
Process Centric Architecture

Focus is on core use cases in the business

Develops
Software Team

www.ACloudFan.com
Services Centric Architecture (SOA | REST)

Focus is on core capabilities exposed as services

Develops
Software Team

www.ACloudFan.com
Object Oriented Architecture (OOA)

Focus is on identifying real work objects classes

Software Team

www.ACloudFan.com
Domain Driven Design

Focus is on the business domain

Software Team

www.ACloudFan.com
Review

• Architects create models using different modeling techniques

• There are multiple architectural styles

• Domain Driven Design = focusses on Business Domain


Domain Models
Understanding the business domain

*
1 Domain model

2 Elements of a Domain model

www.ACloudFan.com
WHY do businesses invest in software?

www.ACloudFan.com
WHY do businesses invest in software?

• To fulfill some need(s) of the business | enterprise

What
Reduce manual labor Automation; Machine Learning
is
Increase Efficiency Workflow engines; Tools
the Real
Competitive Edge Reasons
Customer loyalty; Business Intelligence
for these
…… … needs
www.ACloudFan.com
WHY do businesses invest in software?

• To Solve
fulfill some
someneed(s)
BusinessofProblem(s)
the business | enterprise

Reduce manual labor Automation;


Reduce the sizeMachine Learningto save $$$ !!
of the workforce

Increase Efficiency Customer


Workflowcomplaints about long response times !!
engines; Tools

Competitive Edge Competitors


Customer loyalty;
are pulling
Business
awayIntelligence
customers !!

…… …

www.ACloudFan.com
Business Problems

Current or long-term challenges & issues


faced by the business that may prevent
the business from achieving its goals.

www.ACloudFan.com
To understand the problem, architects MUST understand the domain first !!!
Domain Model

Organized and structured knowledge of


the domain that is relevant for solving a
business problem
Domain Model

www.ACloudFan.com
May contain additional knowledge
Review

• Domain Model = Structured Knowledge

• Purpose = Solution for a Business Problem


Enterprise Domain Models
Also Known as "Aggregate" / "Unified" Domain Model

*
1 Knowledge crunching

2 Enterprise Domain Models

3 What challenges does DDD address?

www.ACloudFan.com
WHO in your Organization REALLY understands your
Org's Business Processes?
www.ACloudFan.com
Domain Experts a.k.a. Subject Matter Experts or SME

Complex Domains - NO one expert knows everything about the


domain !!!

Banking

Retail Accounts Expert Merchant Accounts Expert

Loans Accounts Expert


www.ACloudFan.com Compliance & Regulatory
Domain Experts a.k.a. Subject Matter Experts or SME

Complex Domains - NO one expert knows everything about the


domain !!!

Travel Advisor Partner Contracts

Accounts
Customer Support
www.ACloudFan.com
Knowledge Crunching

Teams process the knowledge received from


the Domain Experts into domain models

This process is referred to as Knowledge


Crunching

www.ACloudFan.com
Knowledge Crunching

Technology Team

Domain Experts Structured Domain Knowledge

www.ACloudFan.com
Technology Team

Led by an experienced technologist

• IT Lead e.g., Architect, Lead Developer ….

• Team members e.g., Developers, Analyst ….

www.ACloudFan.com
Knowledge Crunching

Software
Development
Team

Account
<<Abstract>>

Banking Experts
Savings A/c Loan A/c

Checking A/c

Domain Experts Structured Domain Knowledge

www.ACloudFan.com
Enterprise Models

Knowledge was gathered from multiple experts to create an


enterprise domain model

www.ACloudFan.com
Enterprise Models

Also known as Unified Models Also known as Canonical Models

Also known as Aggregate Models

www.ACloudFan.com
Challenges with Unified models

1 Complexity

2 Ownership

3 Linguistic
www.ACloudFan.com
1 Complexity

Inherent complexity due to scope and size

Overlapping & Redundant capabilities


2 Ownership

No single expert who own's the entire model

Model falls behind the reality and over time loses its value
3 Linguistic

Same business term has different meanings in different domains

Technology teams | Business teams speak different languages


Software Development

Software
Development
Team

Technical
Code
Design
Product
www.ACloudFan.com
Aggregate Domain Models a.k.a. Holistic/Enterprise Domain Model

A domain model that covers all the facets of the domain

Banking

Credit Cards Retail Banking


Knowledge Knowledge

Merchant Services Certificates of


Knowledge Deposit Knowledge

Loans Management
… …
Knowledge

www.ACloudFan.com
Addressing the Challenges

Domain Driven Design approach provides


principles and patterns to address the
challenges faced with developing
complex domain models

www.ACloudFan.com
Review

• Knowledge Crunching = Creating the Domain Model

• Multiple challenges with creating models for complex domains

• DDD addresses these challenges

You might also like