Slide 1

Slide 1 text

Scaling Domain-Driven Design Driving DDD Across Your Organization Otávio Santana, Founder [email protected]

Slide 2

Slide 2 text

Technology as strategic resource Everything is around software! “Every business is a software business” CMMI “Every Company is a Data Company” CIO Network “Every Company is a Software Company” Forbes

Slide 3

Slide 3 text

Software Development Failure? Hyper-Focused Planning And Design Unexpected Complexities Poor Collaboration Between The Product And Engineering Teams Unclear Or Undefined Client Expectations

Slide 4

Slide 4 text

The Complexity Paradox The More Answers We Find, the More Questions We Have Developer experience is a market Trade-offs The hype effect

Slide 5

Slide 5 text

Evolutionary Software? “To prepare to write their classic text Structure Design, Ed Yourdon and Larry Constantine examined programs to find out what made them so expensive. They noticed that the expensive programs all had one property in common: changing one element required changing other elements.” No ready to change anything!

Slide 6

Slide 6 text

Software Erosion “Also known as software rot, code rot, software decay, or software entropy, software rot is either a slow deterioration of software quality over time or its diminishing responsiveness that will eventually lead to software becoming faulty.” Continuous development

Slide 7

Slide 7 text

Software Engineering? A super inefficient way to build something We waste time in meetings Create complexity Not ready for change Premature legacy No achieve client goals

Slide 8

Slide 8 text

Software Engineer Definitions? “Software engineering is the application of an empirical, scientific approach to finding efficient, economical solutions to practical problems in software.”

Slide 9

Slide 9 text

Software Engineer The history Civil Engineering ○ Management of large projects. ○ Modularity and division of labor. Mechanical Engineering ○ Reuse of components. ○ Simulation and performance analysis. ○ Project and manufacturing life cycle. Electrical Engineering ○ Logical foundation and digital circuits. ○ Real-time systems and control. ○ Communication theory. Systems Engineering ○ Modularity and integration. ○ Complexity analysis and risk management.

Slide 10

Slide 10 text

The Set Software Engineering Software Engineer Civil Engineering Mechanical Engineering Electrical Engineering Systems Engineering

Slide 11

Slide 11 text

DDD? The biggest misunderstanding in the software industry! It is a framework! Repository, Entity Microservices Code only Java Complex

Slide 12

Slide 12 text

DDD! Handling and focus to the Business Domains Transfer Knowledge Tactics Strategy

Slide 13

Slide 13 text

Strategic DDD The biggest mistake when implementing DDD Domains and Subdomains Ubiquitous language Context Mapping Bounded Contexts

Slide 14

Slide 14 text

Domains Central area of a company’s operations Subdomain Type Role Business Differentiation Complexity of Business Logic Core Subdomain Unique to the company, defining its identity and competitive advantage High High Generic Subdomain Common across all companies, standard business activities Low High Supporting Subdomain Supports core business activities without providing direct competitive advantage Medium Varies

Slide 15

Slide 15 text

Domains The subdomains types

Slide 16

Slide 16 text

Ubiquitous Language The core's communication Define common terminology The common language between experts and the engineering team. The same word can vary from context

Slide 17

Slide 17 text

Bounded Contexts Subset of the ubiquitous language

Slide 18

Slide 18 text

Context Mapping The relationships between these contexts Shared Kernel Customer-Supplier Conformist Anticorruption Layer Published Language Separate Ways Open Host Service

Slide 19

Slide 19 text

Domain Storytelling A Collaborative, and Visual Way to Build DDD

Slide 20

Slide 20 text

Tactic DDD The second step Entity Service Repository Aggregates

Slide 21

Slide 21 text

Strategic and Tactical Focus on tactics is the start of a huge mistake Get something done Working code isn't enough Tactical tornado Strategic Tactical Time Total progress

Slide 22

Slide 22 text

Governance Automating processes and good practice rules

Slide 23

Slide 23 text

Using Annotations Getting architecture evidences @Entity public class CreditCard { @Identity private BigInteger id; private String number; private String name; private YearMonth expiry; }

Slide 24

Slide 24 text

Governance Automating processes and good practice rules @AnalyzeClasses(packages = "expert.os.examples") public class IntegrationSampleTest { @ArchTest private ArchRule dddRules = JMoleculesDddRules.all(); @ArchTest private ArchRule layering = JMoleculesArchitectureRules.ensureLayering(); }

Slide 25

Slide 25 text

PMD Static source code analyzer Bugs Suboptimal code Dead code Classes with high Cyclomatic Security Complexity measurements. Over Complicated expressions Duplicate code

Slide 26

Slide 26 text

Checkstyle Create your style validations Naming conventions of attributes and methods The presence of mandatory headers The practices of class construction Multiple complexity measurements

Slide 27

Slide 27 text

ArchUnit Putting test at your Architecture and Design

Slide 28

Slide 28 text

xMolecules Architectural abstractions in code. "There is always a leak between the language and the architecture you want to express. Language, like any other tool, shapes what you can do with it, and sometimes it doesn’t allow you to express things the way you'd want from an architectural standpoint." Architecturally Evident Applications – How to Bridge the Model-Code Gap? https://xmolecules.org/aea-paper.pdf

Slide 29

Slide 29 text

Software Architecture There is no space, the business is the goal!

Slide 30

Slide 30 text

The laws Everything in software architecture is a trade-off Why is more important than how Architecture

Slide 31

Slide 31 text

Architecture vs Design The boundaries to DDD

Slide 32

Slide 32 text

Code Changelog README API Documentation The reader is the user

Slide 33

Slide 33 text

C4-model Architecture’s map Tech-radar Technologies's view ADR Don’t repeat the error Communication A clear direction Documentation Architectural perspective

Slide 34

Slide 34 text

The Architecture styles There is a world beyond microservices and Hexagon model

Slide 35

Slide 35 text

The layers The layers definitions from the DDD book Presentation Layer Application Layer Infrastructure Layer Domain Layer

Slide 36

Slide 36 text

The Clean Architecture DDD vs Clean Architecture Presentation Layer Application Layer Infrastructure Layer Domain Layer

Slide 37

Slide 37 text

Refactoring Be ready for change Better Readability Reduced Complexity Improved Maintainability Reduced Technical Debt Enhance Performance Effortless Extensibility Fight against Software Erosion

Slide 38

Slide 38 text

Legacy Modernization Be ready for change

Slide 39

Slide 39 text

Complexity The Enemy to fight against! Complexity is anything related to the structure of a software system that makes it hard to understand and modify the system.

Slide 40

Slide 40 text

Scalability Handle a growing amount A single point of failure Culture Methodology Quality

Slide 41

Slide 41 text

Context Code Design Documentation Software Architecture Ultimate Engineer Test Reaching the ultimate stage of sophistication career as a Software engineer Persistence Leadership

Slide 42

Slide 42 text

Software Engineer & Architect Expert Otavio Santana Java Champion, Oracle ACE Book and blog writer Duke Choice Award Jakarta EE and MicroProfile JCP-EC-EG-EGL Apache and Eclipse Committer JCP Award

Slide 43

Slide 43 text

Thank you! Otávio Santana OS Expert Founder, Software Engineer & Architect [email protected] https://www.linkedin.com/in/otaviojava/ https://www.youtube.com/@otaviojava https://twitter.com/otaviojava