apidays London 2023 - APIs for Smarter Platforms and Business Processes
September 13 & 14, 2023
Why and how to apply DDD to APIs
Radhouane Jrad, Lead Integration Architect at QBE Europe
------
Check out our conferences at https://www.apidays.global/
Do you want to sponsor or talk at one of our conferences?
https://apidays.typeform.com/to/ILJeAaV8
Learn more on APIscene, the global media made by the community for the community:
https://www.apiscene.io
Explore the API ecosystem with the API Landscape:
https://apilandscape.apiscene.io/
2. The Plan
• DDD in General (History, etc.)
• Designing in DDD
• Implementing DDD: Use-Case
• Implementing DDD Principles
• DDD & Horizontal Scalability
• Principles Guiding API Governance
02/23
3. Disclaimer
DDD is a rich, complex, sometimes antagonistic topic. This presentation is an implementation of
DDD and some aspects may differ from other implementations.
The views in this presentation fairly (but not fully) adhere to standard DDD concepts.
03/23
4. Mantra
As a developer, it is your understanding, rather than your knowledge, that becomes software!
Alberto Brandolini
04/23
6. How Did We Get to DDD?
Business Model Business Domain
Domain Driven
Design
• Describes core aspects of company’s values
(economic, social, environmental, etc.) & how it
‘lives’ them
• Reflects rationale of a company’s purposes,
processes, markets, products & services, strategies,
infrastructure, operational processes, policies, etc.
Business Strategy
• Defines goals of the company
• Competitive matters: How to fight & compete?
What are our strengths & weaknesses? Where
are market opportunities? Lateral concerns
(social, societal, environmental, etc.)
• Different to Operational Strategy (efficiency, cost
mgmt., etc.)
Corporate Strategy
• Existential matters:
• What business should
we be in?
• What business should
we NOT be in?
• Essentially, 2 types of models:
• Linear (aka Pipes): upstream production &
downstream consumption,
e.g. ink > pen + lid > wholesale
• Networked (aka Platforms): multi-directional
exchange (e.g. Digital Transformation)
• We start getting technical:
• A “simple view” of a “complex Reality (UML)
• Class-based representation of objects being implemented
• Generated through Business Modelling & designed by Business
Analysts.
• Categorises the set of business systems that represent autonomous
units of the business modeled during Business Analysis.
Strategy
Operations
Infrastructure
• Aim is to structure the code and its language to
reflect the Business Domain
• e.g. Class ClaimApplication; + Class Customer +
method approveClaim + method rejectClaim
06/23
7. The Concept of Domain Driven Design
Business Domain
Domain Driven
Design
• We start getting technical:
• A “simple view” of a “complex Reality (UML)
• Class-based representation of objects being implemented
• Generated through Business Modelling & designed by Business
Analysts.
• Categorises the set of business systems that represent autonomous
units of the business modeled during Business Analysis.
• Aim is to structure the code and its language to
reflect the Business Domain
• e.g. Class ClaimApplication; + Class Customer +
method approveClaim + method rejectClaim
06/23
13. Insurance Example
Customer =
Active policies,
historical
policies, MTA
Domain: Policy
Customer =
Open claims,
historical claims,
NCD status
Domain: Claim
Customer =
Name, physical
address, mobile
no.
Domain: Party
DB
API
DB
API
DB
API
12/23
16. Policy
Domain Gateway Layer APIs
15/23
Claims
DGL API
AL API
ACL API
DGL API
AL API
ACL API
Consumer A
Sys. Of.
Rec
• DGL API act as gateway to the
domain
• Every domain’s Abstract Layer is
constructed, developed, and
maintained ignoring other domains
• Every domain’s ACL is constructed,
developed, and maintained ignoring
other domains
• Security, Infrastructure,Testing, and
Asset Reusability requirements are
easy to address
• Usually one DGL API per Domain.