SlideShare a Scribd company logo
Towards a UML Profile for Domain-driven Design of
Microservice Architectures
Microservices 2017
Florian Rademacher
University of Applied Sciences and Arts Dortmund
Institute for Digital Transformation of Application and Living Domains
florian.rademacher@fh-dortmund.de
October 25, 2017 – Odense, Denmark
Table of Contents
1 Introduction
2 Research Questions
3 Survey on UML Elements in Domain-driven Design
4 A UML Profile for Domain-driven Microservice Architecture Modeling
5 Conclusion and Future Work
Florian Rademacher Towards a UML Profile for Domain-driven Design of MSAs 1
Table of Contents
1 Introduction
2 Research Questions
3 Survey on UML Elements in Domain-driven Design
4 A UML Profile for Domain-driven Microservice Architecture Modeling
5 Conclusion and Future Work
Florian Rademacher Towards a UML Profile for Domain-driven Design of MSAs 2
The published Paper
presentation of our paper “Towards a UML Profile for Domain-driven
Design of Microservice Architectures” from this year’s Microservices:
Science and Engineering Workshop (MSE@SEFM 2017)
preprint available online
(see the abstract at http://conf-micro.services for the link)
Florian Rademacher Towards a UML Profile for Domain-driven Design of MSAs 3
Domain-driven Design
Domain-driven Design (DDD)
set of model-driven practices, techniques and principles for software
design
primary design drivers: application domain, concepts and concept
relationships
selected core principles
... capturing of domain knowledge in domain models
... collaborative modeling of domain experts and software engineers
(⇒ ubiquitous language)
Florian Rademacher Towards a UML Profile for Domain-driven Design of MSAs 4
Domain-driven Design
Structural Domain Models
selective abstractions of conceptual knowledge about a domain or
relevant domain parts
typically modeled as informal UML class diagrams with DDD patterns
like Entity, Value Object, Aggregate, Repository
role
Cargo Aggregate
*
Customer Repository
find by name(String)
find by Customer ID(String)
Cargo Repository
find by Tracking ID(String)
find by Customer ID(String)
Delivery Specification Value Object
arrival time
Handling Event Entity
completion time
type
Customer Entity
name
customer ID
*
*
goal
handled
*
Cargo Entity
tracking ID
Figure 1: Structural domain model with DDD patterns1
1
Evans, Domain-Driven Design, 2004.
Florian Rademacher Towards a UML Profile for Domain-driven Design of MSAs 5
Domain-driven Design and Microservice Architecture
DDD and MSA2
1 identification of Bounded Contexts and shared Value Objects in
domain models
2 mapping of Bounded Contexts and shared Value Objects to functional
Microservices and interfaces
role
Cargo Bounded Context
Customer Shared Value Object
customer ID
Customer Bounded Context
Cargo Aggregate
*
Customer Repository
find by name(String)
find by Customer ID(String)
Cargo Repository
find by Tracking ID(String)
find by Customer ID(String)
Delivery Specification Value Object
arrival time
Handling Event Entity
completion time
type
Customer Entity
name
customer ID
«use»
*
*
goal
handled
*
Cargo Entity
tracking ID
Figure 2: Domain model with Bounded Contexts and shared Value Object
2
Newman, Building Microservices, 2015.
Florian Rademacher Towards a UML Profile for Domain-driven Design of MSAs 6
Domain-driven Design and Microservice Architecture
Limitation: DDD is rather informal
DDD patterns lack formal, UML-based foundation
DDD patterns differ in notation
⇒ prevention of structured model operations like model transformation or
semantic validation
⇒ decrease of models’ possible value
Florian Rademacher Towards a UML Profile for Domain-driven Design of MSAs 7
Table of Contents
1 Introduction
2 Research Questions
3 Survey on UML Elements in Domain-driven Design
4 A UML Profile for Domain-driven Microservice Architecture Modeling
5 Conclusion and Future Work
Florian Rademacher Towards a UML Profile for Domain-driven Design of MSAs 8
Research Questions
RQ 1
Next to DDD patterns, which basic modeling constructs need to be
supported for Domain-driven Microservice Architecture Modeling
(DDMM)?
RQ 2.1
How can UML’s profile mechanism be utilized to support DDMM?
RQ 2.2
Which basic model transformations need to be supported for DDMM?
Florian Rademacher Towards a UML Profile for Domain-driven Design of MSAs 9
Table of Contents
1 Introduction
2 Research Questions
3 Survey on UML Elements in Domain-driven Design
4 A UML Profile for Domain-driven Microservice Architecture Modeling
5 Conclusion and Future Work
Florian Rademacher Towards a UML Profile for Domain-driven Design of MSAs 10
Survey on UML Elements in DDD
Survey on UML Elements in DDD
survey of 92 UML class diagrams3
representing real-world structural
domain models
results (UML-conform elements only):
# Element Category Occurrence Count
1 Class Classes 92 (100%)
2 Attribute Attributes 72 (78.26%)
3 Multiplicity Multiplicities 67 (72.82%)
4 Non-navigable Association Associations 58 (63.04%)
5 Method Methods 49 (53.26%)
6 Unidirectional Navigable Association Associations 36 (39.13%)
7 Non-navigable Aggregation Associations 28 (30.43%)
8 “extends” Relationship (Inheritance) Associations 23 (25%)
9 Informal Constraint Constraints 13 (14.13%)
10 Unidirectional Navigable Aggregation Associations 11 (11.95%)
11 Formal Constraint Constraints 6 (6.52%)
12 Semi-formal Constraint Constraints 3 (3.26%)
13 Class Dependency Associations 2 (2.17%)
Table 1: Results of surveying UML elements of structural domain models
3
from Evans, Domain-Driven Design, 2004.
Florian Rademacher Towards a UML Profile for Domain-driven Design of MSAs 11
Survey on UML Elements in DDD
Survey on UML Elements in DDD
survey of 92 UML class diagrams3
representing real-world structural
domain models
results (UML-conform elements only):
# Element Category Occurrence Count
1 Class Classes 92 (100%)
2 Attribute Attributes 72 (78.26%)
3 Multiplicity Multiplicities 67 (72.82%)
4 Non-navigable Association Associations 58 (63.04%)
5 Method Methods 49 (53.26%)
6 Unidirectional Navigable Association Associations 36 (39.13%)
7 Non-navigable Aggregation Associations 28 (30.43%)
8 “extends” Relationship (Inheritance) Associations 23 (25%)
9 Informal Constraint Constraints 13 (14.13%)
10 Unidirectional Navigable Aggregation Associations 11 (11.95%)
11 Formal Constraint Constraints 6 (6.52%)
12 Semi-formal Constraint Constraints 3 (3.26%)
13 Class Dependency Associations 2 (2.17%)
Table 1: Results of surveying UML elements of structural domain models
3
from Evans, Domain-Driven Design, 2004.
Florian Rademacher Towards a UML Profile for Domain-driven Design of MSAs 11
Survey on UML Elements in DDD
Survey on UML Elements in DDD
survey of 92 UML class diagrams3
representing real-world structural
domain models
results (UML-conform elements only):
# Element Category Occurrence Count
1 Class Classes 92 (100%)
2 Attribute Attributes 72 (78.26%)
3 Multiplicity Multiplicities 67 (72.82%)
4 Non-navigable Association Associations 58 (63.04%)
5 Method Methods 49 (53.26%)
6 Unidirectional Navigable Association Associations 36 (39.13%)
7 Non-navigable Aggregation Associations 28 (30.43%)
8 “extends” Relationship (Inheritance) Associations 23 (25%)
9 Informal Constraint Constraints 13 (14.13%)
10 Unidirectional Navigable Aggregation Associations 11 (11.95%)
11 Formal Constraint Constraints 6 (6.52%)
12 Semi-formal Constraint Constraints 3 (3.26%)
13 Class Dependency Associations 2 (2.17%)
Table 1: Results of surveying UML elements of structural domain models
3
from Evans, Domain-Driven Design, 2004.
Florian Rademacher Towards a UML Profile for Domain-driven Design of MSAs 11
Survey on UML Elements in DDD
Survey on UML Elements in DDD
survey of 92 UML class diagrams3
representing real-world structural
domain models
results (UML-conform elements only):
# Element Category Occurrence Count
1 Class Classes 92 (100%)
2 Attribute Attributes 72 (78.26%)
3 Multiplicity Multiplicities 67 (72.82%)
4 Non-navigable Association Associations 58 (63.04%)
5 Method Methods 49 (53.26%)
6 Unidirectional Navigable Association Associations 36 (39.13%)
7 Non-navigable Aggregation Associations 28 (30.43%)
8 “extends” Relationship (Inheritance) Associations 23 (25%)
9 Informal Constraint Constraints 13 (14.13%)
10 Unidirectional Navigable Aggregation Associations 11 (11.95%)
11 Formal Constraint Constraints 6 (6.52%)
12 Semi-formal Constraint Constraints 3 (3.26%)
13 Class Dependency Associations 2 (2.17%)
Table 1: Results of surveying UML elements of structural domain models
3
from Evans, Domain-Driven Design, 2004.
Florian Rademacher Towards a UML Profile for Domain-driven Design of MSAs 11
Survey on UML Elements in DDD
Survey on UML Elements in DDD
survey of 92 UML class diagrams3
representing real-world structural
domain models
results (UML-conform elements only):
# Element Category Occurrence Count
1 Class Classes 92 (100%)
2 Attribute Attributes 72 (78.26%)
3 Multiplicity Multiplicities 67 (72.82%)
4 Non-navigable Association Associations 58 (63.04%)
5 Method Methods 49 (53.26%)
6 Unidirectional Navigable Association Associations 36 (39.13%)
7 Non-navigable Aggregation Associations 28 (30.43%)
8 “extends” Relationship (Inheritance) Associations 23 (25%)
9 Informal Constraint Constraints 13 (14.13%)
10 Unidirectional Navigable Aggregation Associations 11 (11.95%)
11 Formal Constraint Constraints 6 (6.52%)
12 Semi-formal Constraint Constraints 3 (3.26%)
13 Class Dependency Associations 2 (2.17%)
Table 1: Results of surveying UML elements of structural domain models
3
from Evans, Domain-Driven Design, 2004.
Florian Rademacher Towards a UML Profile for Domain-driven Design of MSAs 11
Survey on UML Elements in DDD
Survey on UML Elements in DDD
survey of 92 UML class diagrams3
representing real-world structural
domain models
results (UML-conform elements only):
# Element Category Occurrence Count
1 Class Classes 92 (100%)
2 Attribute Attributes 72 (78.26%)
3 Multiplicity Multiplicities 67 (72.82%)
4 Non-navigable Association Associations 58 (63.04%)
5 Method Methods 49 (53.26%)
6 Unidirectional Navigable Association Associations 36 (39.13%)
7 Non-navigable Aggregation Associations 28 (30.43%)
8 “extends” Relationship (Inheritance) Associations 23 (25%)
9 Informal Constraint Constraints 13 (14.13%)
10 Unidirectional Navigable Aggregation Associations 11 (11.95%)
11 Formal Constraint Constraints 6 (6.52%)
12 Semi-formal Constraint Constraints 3 (3.26%)
13 Class Dependency Associations 2 (2.17%)
Table 1: Results of surveying UML elements of structural domain models
3
from Evans, Domain-Driven Design, 2004.
Florian Rademacher Towards a UML Profile for Domain-driven Design of MSAs 11
Table of Contents
1 Introduction
2 Research Questions
3 Survey on UML Elements in Domain-driven Design
4 A UML Profile for Domain-driven Microservice Architecture Modeling
5 Conclusion and Future Work
Florian Rademacher Towards a UML Profile for Domain-driven Design of MSAs 12
A UML Profile for Domain-driven MSA Modeling
A UML Profile for Domain-driven MSA Modeling
stereotypes for DDD patterns as extensions to UML metaclasses
«Stereotype»
Module
«Stereotype»
AggregatePart
aggregateRoot : Class
«Stereotype»
AggregateRoot
«Stereotype»
BoundedContext
«Metaclass»
Package
«Stereotype»
Closure
«Stereotype»
SideEffectFree
«Stereotype»
ValidatesSpec
«Stereotype»
Spec
«Stereotype»
Repository
«Stereotype»
Entity
«Stereotype»
Service
«Stereotype»
DefinesIdentity
«Stereotype»
ValueObject
immutable : Boolean
«Metaclass»
Property
«Metaclass»
Operation
«Metaclass»
Class
Figure 3: The UML profile’s stereotypes for DDD patterns
Florian Rademacher Towards a UML Profile for Domain-driven Design of MSAs 13
A UML Profile for Domain-driven MSA Modeling
A UML Profile for Domain-driven MSA Modeling
OCL constraints to ensure intended usage of pattern stereotypes
Stereotype Constraints based on UML Metamodel
AggregatePart
C1: Only Entities and Value Objects may be Aggregate parts
C2: Assigned Aggregate root must have AggregateRoot stereotype
C3: No incoming Associations from outside the Aggregate
C4: Must be in same Bounded Context as Aggregate root
AggregateRoot
C5: Only Entities may be Aggregate roots
C6: Aggregate must contain at least one part
Entity C7: One Operation or at least one Property defines the identity
Repository
C8: Class has no other stereotypes
C9: Class contains only Operations and at least one
C10: Outgoing Associations must point to Entities or Value Objects
DefinesIdentity
C19: Must not be specification validation Operation
C20: May only be applied within Entities
BoundedContext
C24: Must not have Module stereotype
C25: Must not be nested, i.e. part of another Package
Table 2: Selected stereotype constraints
Florian Rademacher Towards a UML Profile for Domain-driven Design of MSAs 14
A UML Profile for Domain-driven MSA Modeling
Mapping profile-based models to MSA implementation
determination of Microservice interfaces from Bounded Contexts
on the basis of context associations
associated context-external concepts or shared Value Objects as
signature types
DDD patterns Repository or Service for explicit interface operation
definition
open question 1: How to specify technical characteristics?
open question 2: Which concrete operation of Repository or Service
shall be used?
open question 3: Which concrete shared Value Object shall be used?
Florian Rademacher Towards a UML Profile for Domain-driven Design of MSAs 15
Table of Contents
1 Introduction
2 Research Questions
3 Survey on UML Elements in Domain-driven Design
4 A UML Profile for Domain-driven Microservice Architecture Modeling
5 Conclusion and Future Work
Florian Rademacher Towards a UML Profile for Domain-driven Design of MSAs 16
Conclusion and Future Work
Conclusion
characterization of DDD by means of a literature survey with 92
structural domain models
initial UML profile for DDMM
Future Work
main focus: implementation of model transformations for eventually
deriving MSA code from profile-based models
transformation of Bounded Contexts into services with deriving
interfaces from context associations
Florian Rademacher Towards a UML Profile for Domain-driven Design of MSAs 17

More Related Content

PDF
The Agile Stakeholder Management Framework for Teams, Programs, and Portfolios
PDF
Topic 13 - Project Resource Management.pdf
PDF
Program and Project Financial Management in Project Online
PPTX
Product Manager or Product Owner
PPTX
Case Learning and Case Analysis
PPT
Pinto pm2 ch02
PPTX
PMP Exam Prep Module 1.pptx
PDF
Project Management...Globalization And Cultural Diversity
The Agile Stakeholder Management Framework for Teams, Programs, and Portfolios
Topic 13 - Project Resource Management.pdf
Program and Project Financial Management in Project Online
Product Manager or Product Owner
Case Learning and Case Analysis
Pinto pm2 ch02
PMP Exam Prep Module 1.pptx
Project Management...Globalization And Cultural Diversity

Similar to Towards a UML Profile for Domain-driven Design of Microservice Architectures (20)

PDF
Best Practices in Object Oriented Analysis and Design
PPTX
Developing Tools for “What if…” Testing of Large-scale Software Systems
PPT
Apostila UML
PDF
Mathematical Modeling using MATLAB, by U.M. Sundar Senior Application Enginee...
PPT
itec315_lecture 9 about object oriented analysis and design
ODP
Software Patterns
PPT
Design engineering
PPT
Design engineering
PPTX
PhD defense: David Ameller
PDF
SADP PPTs of all modules - Shanthi D.L.pdf
PDF
slide_10_DistributiondFDASFDadfsdfadf.pdf
PPTX
UML Modeling and Profiling Lab - Advanced Software Engineering Course 2014/2015
PPT
Introduction To Uml
PPTX
Architecture & TYPO3
PPT
Sw Software Design
PPTX
Crafted Design - LJC World Tour Mash Up 2014
PDF
Application Of UML In Real-Time Embedded Systems
PDF
A practical approach for model based slicing
PDF
Domain Modelling
PDF
SodiusCassidianmdday2010 101129081449-phpapp02
Best Practices in Object Oriented Analysis and Design
Developing Tools for “What if…” Testing of Large-scale Software Systems
Apostila UML
Mathematical Modeling using MATLAB, by U.M. Sundar Senior Application Enginee...
itec315_lecture 9 about object oriented analysis and design
Software Patterns
Design engineering
Design engineering
PhD defense: David Ameller
SADP PPTs of all modules - Shanthi D.L.pdf
slide_10_DistributiondFDASFDadfsdfadf.pdf
UML Modeling and Profiling Lab - Advanced Software Engineering Course 2014/2015
Introduction To Uml
Architecture & TYPO3
Sw Software Design
Crafted Design - LJC World Tour Mash Up 2014
Application Of UML In Real-Time Embedded Systems
A practical approach for model based slicing
Domain Modelling
SodiusCassidianmdday2010 101129081449-phpapp02
Ad

Recently uploaded (20)

PPTX
Introduction to Cardiovascular system_structure and functions-1
PPTX
Classification Systems_TAXONOMY_SCIENCE8.pptx
PPTX
ognitive-behavioral therapy, mindfulness-based approaches, coping skills trai...
PPTX
Comparative Structure of Integument in Vertebrates.pptx
PDF
Phytochemical Investigation of Miliusa longipes.pdf
PPTX
microscope-Lecturecjchchchchcuvuvhc.pptx
PPTX
ECG_Course_Presentation د.محمد صقران ppt
PDF
SEHH2274 Organic Chemistry Notes 1 Structure and Bonding.pdf
PPTX
Protein & Amino Acid Structures Levels of protein structure (primary, seconda...
PPT
protein biochemistry.ppt for university classes
PPTX
2Systematics of Living Organisms t-.pptx
PDF
Formation of Supersonic Turbulence in the Primordial Star-forming Cloud
PPTX
EPIDURAL ANESTHESIA ANATOMY AND PHYSIOLOGY.pptx
PDF
Placing the Near-Earth Object Impact Probability in Context
PPTX
2. Earth - The Living Planet Module 2ELS
PDF
The scientific heritage No 166 (166) (2025)
PPTX
G5Q1W8 PPT SCIENCE.pptx 2025-2026 GRADE 5
PDF
Unveiling a 36 billion solar mass black hole at the centre of the Cosmic Hors...
PPTX
neck nodes and dissection types and lymph nodes levels
PPT
The World of Physical Science, • Labs: Safety Simulation, Measurement Practice
Introduction to Cardiovascular system_structure and functions-1
Classification Systems_TAXONOMY_SCIENCE8.pptx
ognitive-behavioral therapy, mindfulness-based approaches, coping skills trai...
Comparative Structure of Integument in Vertebrates.pptx
Phytochemical Investigation of Miliusa longipes.pdf
microscope-Lecturecjchchchchcuvuvhc.pptx
ECG_Course_Presentation د.محمد صقران ppt
SEHH2274 Organic Chemistry Notes 1 Structure and Bonding.pdf
Protein & Amino Acid Structures Levels of protein structure (primary, seconda...
protein biochemistry.ppt for university classes
2Systematics of Living Organisms t-.pptx
Formation of Supersonic Turbulence in the Primordial Star-forming Cloud
EPIDURAL ANESTHESIA ANATOMY AND PHYSIOLOGY.pptx
Placing the Near-Earth Object Impact Probability in Context
2. Earth - The Living Planet Module 2ELS
The scientific heritage No 166 (166) (2025)
G5Q1W8 PPT SCIENCE.pptx 2025-2026 GRADE 5
Unveiling a 36 billion solar mass black hole at the centre of the Cosmic Hors...
neck nodes and dissection types and lymph nodes levels
The World of Physical Science, • Labs: Safety Simulation, Measurement Practice
Ad

Towards a UML Profile for Domain-driven Design of Microservice Architectures

  • 1. Towards a UML Profile for Domain-driven Design of Microservice Architectures Microservices 2017 Florian Rademacher University of Applied Sciences and Arts Dortmund Institute for Digital Transformation of Application and Living Domains florian.rademacher@fh-dortmund.de October 25, 2017 – Odense, Denmark
  • 2. Table of Contents 1 Introduction 2 Research Questions 3 Survey on UML Elements in Domain-driven Design 4 A UML Profile for Domain-driven Microservice Architecture Modeling 5 Conclusion and Future Work Florian Rademacher Towards a UML Profile for Domain-driven Design of MSAs 1
  • 3. Table of Contents 1 Introduction 2 Research Questions 3 Survey on UML Elements in Domain-driven Design 4 A UML Profile for Domain-driven Microservice Architecture Modeling 5 Conclusion and Future Work Florian Rademacher Towards a UML Profile for Domain-driven Design of MSAs 2
  • 4. The published Paper presentation of our paper “Towards a UML Profile for Domain-driven Design of Microservice Architectures” from this year’s Microservices: Science and Engineering Workshop (MSE@SEFM 2017) preprint available online (see the abstract at http://conf-micro.services for the link) Florian Rademacher Towards a UML Profile for Domain-driven Design of MSAs 3
  • 5. Domain-driven Design Domain-driven Design (DDD) set of model-driven practices, techniques and principles for software design primary design drivers: application domain, concepts and concept relationships selected core principles ... capturing of domain knowledge in domain models ... collaborative modeling of domain experts and software engineers (⇒ ubiquitous language) Florian Rademacher Towards a UML Profile for Domain-driven Design of MSAs 4
  • 6. Domain-driven Design Structural Domain Models selective abstractions of conceptual knowledge about a domain or relevant domain parts typically modeled as informal UML class diagrams with DDD patterns like Entity, Value Object, Aggregate, Repository role Cargo Aggregate * Customer Repository find by name(String) find by Customer ID(String) Cargo Repository find by Tracking ID(String) find by Customer ID(String) Delivery Specification Value Object arrival time Handling Event Entity completion time type Customer Entity name customer ID * * goal handled * Cargo Entity tracking ID Figure 1: Structural domain model with DDD patterns1 1 Evans, Domain-Driven Design, 2004. Florian Rademacher Towards a UML Profile for Domain-driven Design of MSAs 5
  • 7. Domain-driven Design and Microservice Architecture DDD and MSA2 1 identification of Bounded Contexts and shared Value Objects in domain models 2 mapping of Bounded Contexts and shared Value Objects to functional Microservices and interfaces role Cargo Bounded Context Customer Shared Value Object customer ID Customer Bounded Context Cargo Aggregate * Customer Repository find by name(String) find by Customer ID(String) Cargo Repository find by Tracking ID(String) find by Customer ID(String) Delivery Specification Value Object arrival time Handling Event Entity completion time type Customer Entity name customer ID «use» * * goal handled * Cargo Entity tracking ID Figure 2: Domain model with Bounded Contexts and shared Value Object 2 Newman, Building Microservices, 2015. Florian Rademacher Towards a UML Profile for Domain-driven Design of MSAs 6
  • 8. Domain-driven Design and Microservice Architecture Limitation: DDD is rather informal DDD patterns lack formal, UML-based foundation DDD patterns differ in notation ⇒ prevention of structured model operations like model transformation or semantic validation ⇒ decrease of models’ possible value Florian Rademacher Towards a UML Profile for Domain-driven Design of MSAs 7
  • 9. Table of Contents 1 Introduction 2 Research Questions 3 Survey on UML Elements in Domain-driven Design 4 A UML Profile for Domain-driven Microservice Architecture Modeling 5 Conclusion and Future Work Florian Rademacher Towards a UML Profile for Domain-driven Design of MSAs 8
  • 10. Research Questions RQ 1 Next to DDD patterns, which basic modeling constructs need to be supported for Domain-driven Microservice Architecture Modeling (DDMM)? RQ 2.1 How can UML’s profile mechanism be utilized to support DDMM? RQ 2.2 Which basic model transformations need to be supported for DDMM? Florian Rademacher Towards a UML Profile for Domain-driven Design of MSAs 9
  • 11. Table of Contents 1 Introduction 2 Research Questions 3 Survey on UML Elements in Domain-driven Design 4 A UML Profile for Domain-driven Microservice Architecture Modeling 5 Conclusion and Future Work Florian Rademacher Towards a UML Profile for Domain-driven Design of MSAs 10
  • 12. Survey on UML Elements in DDD Survey on UML Elements in DDD survey of 92 UML class diagrams3 representing real-world structural domain models results (UML-conform elements only): # Element Category Occurrence Count 1 Class Classes 92 (100%) 2 Attribute Attributes 72 (78.26%) 3 Multiplicity Multiplicities 67 (72.82%) 4 Non-navigable Association Associations 58 (63.04%) 5 Method Methods 49 (53.26%) 6 Unidirectional Navigable Association Associations 36 (39.13%) 7 Non-navigable Aggregation Associations 28 (30.43%) 8 “extends” Relationship (Inheritance) Associations 23 (25%) 9 Informal Constraint Constraints 13 (14.13%) 10 Unidirectional Navigable Aggregation Associations 11 (11.95%) 11 Formal Constraint Constraints 6 (6.52%) 12 Semi-formal Constraint Constraints 3 (3.26%) 13 Class Dependency Associations 2 (2.17%) Table 1: Results of surveying UML elements of structural domain models 3 from Evans, Domain-Driven Design, 2004. Florian Rademacher Towards a UML Profile for Domain-driven Design of MSAs 11
  • 13. Survey on UML Elements in DDD Survey on UML Elements in DDD survey of 92 UML class diagrams3 representing real-world structural domain models results (UML-conform elements only): # Element Category Occurrence Count 1 Class Classes 92 (100%) 2 Attribute Attributes 72 (78.26%) 3 Multiplicity Multiplicities 67 (72.82%) 4 Non-navigable Association Associations 58 (63.04%) 5 Method Methods 49 (53.26%) 6 Unidirectional Navigable Association Associations 36 (39.13%) 7 Non-navigable Aggregation Associations 28 (30.43%) 8 “extends” Relationship (Inheritance) Associations 23 (25%) 9 Informal Constraint Constraints 13 (14.13%) 10 Unidirectional Navigable Aggregation Associations 11 (11.95%) 11 Formal Constraint Constraints 6 (6.52%) 12 Semi-formal Constraint Constraints 3 (3.26%) 13 Class Dependency Associations 2 (2.17%) Table 1: Results of surveying UML elements of structural domain models 3 from Evans, Domain-Driven Design, 2004. Florian Rademacher Towards a UML Profile for Domain-driven Design of MSAs 11
  • 14. Survey on UML Elements in DDD Survey on UML Elements in DDD survey of 92 UML class diagrams3 representing real-world structural domain models results (UML-conform elements only): # Element Category Occurrence Count 1 Class Classes 92 (100%) 2 Attribute Attributes 72 (78.26%) 3 Multiplicity Multiplicities 67 (72.82%) 4 Non-navigable Association Associations 58 (63.04%) 5 Method Methods 49 (53.26%) 6 Unidirectional Navigable Association Associations 36 (39.13%) 7 Non-navigable Aggregation Associations 28 (30.43%) 8 “extends” Relationship (Inheritance) Associations 23 (25%) 9 Informal Constraint Constraints 13 (14.13%) 10 Unidirectional Navigable Aggregation Associations 11 (11.95%) 11 Formal Constraint Constraints 6 (6.52%) 12 Semi-formal Constraint Constraints 3 (3.26%) 13 Class Dependency Associations 2 (2.17%) Table 1: Results of surveying UML elements of structural domain models 3 from Evans, Domain-Driven Design, 2004. Florian Rademacher Towards a UML Profile for Domain-driven Design of MSAs 11
  • 15. Survey on UML Elements in DDD Survey on UML Elements in DDD survey of 92 UML class diagrams3 representing real-world structural domain models results (UML-conform elements only): # Element Category Occurrence Count 1 Class Classes 92 (100%) 2 Attribute Attributes 72 (78.26%) 3 Multiplicity Multiplicities 67 (72.82%) 4 Non-navigable Association Associations 58 (63.04%) 5 Method Methods 49 (53.26%) 6 Unidirectional Navigable Association Associations 36 (39.13%) 7 Non-navigable Aggregation Associations 28 (30.43%) 8 “extends” Relationship (Inheritance) Associations 23 (25%) 9 Informal Constraint Constraints 13 (14.13%) 10 Unidirectional Navigable Aggregation Associations 11 (11.95%) 11 Formal Constraint Constraints 6 (6.52%) 12 Semi-formal Constraint Constraints 3 (3.26%) 13 Class Dependency Associations 2 (2.17%) Table 1: Results of surveying UML elements of structural domain models 3 from Evans, Domain-Driven Design, 2004. Florian Rademacher Towards a UML Profile for Domain-driven Design of MSAs 11
  • 16. Survey on UML Elements in DDD Survey on UML Elements in DDD survey of 92 UML class diagrams3 representing real-world structural domain models results (UML-conform elements only): # Element Category Occurrence Count 1 Class Classes 92 (100%) 2 Attribute Attributes 72 (78.26%) 3 Multiplicity Multiplicities 67 (72.82%) 4 Non-navigable Association Associations 58 (63.04%) 5 Method Methods 49 (53.26%) 6 Unidirectional Navigable Association Associations 36 (39.13%) 7 Non-navigable Aggregation Associations 28 (30.43%) 8 “extends” Relationship (Inheritance) Associations 23 (25%) 9 Informal Constraint Constraints 13 (14.13%) 10 Unidirectional Navigable Aggregation Associations 11 (11.95%) 11 Formal Constraint Constraints 6 (6.52%) 12 Semi-formal Constraint Constraints 3 (3.26%) 13 Class Dependency Associations 2 (2.17%) Table 1: Results of surveying UML elements of structural domain models 3 from Evans, Domain-Driven Design, 2004. Florian Rademacher Towards a UML Profile for Domain-driven Design of MSAs 11
  • 17. Survey on UML Elements in DDD Survey on UML Elements in DDD survey of 92 UML class diagrams3 representing real-world structural domain models results (UML-conform elements only): # Element Category Occurrence Count 1 Class Classes 92 (100%) 2 Attribute Attributes 72 (78.26%) 3 Multiplicity Multiplicities 67 (72.82%) 4 Non-navigable Association Associations 58 (63.04%) 5 Method Methods 49 (53.26%) 6 Unidirectional Navigable Association Associations 36 (39.13%) 7 Non-navigable Aggregation Associations 28 (30.43%) 8 “extends” Relationship (Inheritance) Associations 23 (25%) 9 Informal Constraint Constraints 13 (14.13%) 10 Unidirectional Navigable Aggregation Associations 11 (11.95%) 11 Formal Constraint Constraints 6 (6.52%) 12 Semi-formal Constraint Constraints 3 (3.26%) 13 Class Dependency Associations 2 (2.17%) Table 1: Results of surveying UML elements of structural domain models 3 from Evans, Domain-Driven Design, 2004. Florian Rademacher Towards a UML Profile for Domain-driven Design of MSAs 11
  • 18. Table of Contents 1 Introduction 2 Research Questions 3 Survey on UML Elements in Domain-driven Design 4 A UML Profile for Domain-driven Microservice Architecture Modeling 5 Conclusion and Future Work Florian Rademacher Towards a UML Profile for Domain-driven Design of MSAs 12
  • 19. A UML Profile for Domain-driven MSA Modeling A UML Profile for Domain-driven MSA Modeling stereotypes for DDD patterns as extensions to UML metaclasses «Stereotype» Module «Stereotype» AggregatePart aggregateRoot : Class «Stereotype» AggregateRoot «Stereotype» BoundedContext «Metaclass» Package «Stereotype» Closure «Stereotype» SideEffectFree «Stereotype» ValidatesSpec «Stereotype» Spec «Stereotype» Repository «Stereotype» Entity «Stereotype» Service «Stereotype» DefinesIdentity «Stereotype» ValueObject immutable : Boolean «Metaclass» Property «Metaclass» Operation «Metaclass» Class Figure 3: The UML profile’s stereotypes for DDD patterns Florian Rademacher Towards a UML Profile for Domain-driven Design of MSAs 13
  • 20. A UML Profile for Domain-driven MSA Modeling A UML Profile for Domain-driven MSA Modeling OCL constraints to ensure intended usage of pattern stereotypes Stereotype Constraints based on UML Metamodel AggregatePart C1: Only Entities and Value Objects may be Aggregate parts C2: Assigned Aggregate root must have AggregateRoot stereotype C3: No incoming Associations from outside the Aggregate C4: Must be in same Bounded Context as Aggregate root AggregateRoot C5: Only Entities may be Aggregate roots C6: Aggregate must contain at least one part Entity C7: One Operation or at least one Property defines the identity Repository C8: Class has no other stereotypes C9: Class contains only Operations and at least one C10: Outgoing Associations must point to Entities or Value Objects DefinesIdentity C19: Must not be specification validation Operation C20: May only be applied within Entities BoundedContext C24: Must not have Module stereotype C25: Must not be nested, i.e. part of another Package Table 2: Selected stereotype constraints Florian Rademacher Towards a UML Profile for Domain-driven Design of MSAs 14
  • 21. A UML Profile for Domain-driven MSA Modeling Mapping profile-based models to MSA implementation determination of Microservice interfaces from Bounded Contexts on the basis of context associations associated context-external concepts or shared Value Objects as signature types DDD patterns Repository or Service for explicit interface operation definition open question 1: How to specify technical characteristics? open question 2: Which concrete operation of Repository or Service shall be used? open question 3: Which concrete shared Value Object shall be used? Florian Rademacher Towards a UML Profile for Domain-driven Design of MSAs 15
  • 22. Table of Contents 1 Introduction 2 Research Questions 3 Survey on UML Elements in Domain-driven Design 4 A UML Profile for Domain-driven Microservice Architecture Modeling 5 Conclusion and Future Work Florian Rademacher Towards a UML Profile for Domain-driven Design of MSAs 16
  • 23. Conclusion and Future Work Conclusion characterization of DDD by means of a literature survey with 92 structural domain models initial UML profile for DDMM Future Work main focus: implementation of model transformations for eventually deriving MSA code from profile-based models transformation of Bounded Contexts into services with deriving interfaces from context associations Florian Rademacher Towards a UML Profile for Domain-driven Design of MSAs 17