Domain-Driven Design & Application Patterns
Modeling software around the business domain and organizing the application layer around that model. This area covers DDD's strategic and tactical halves, model-driven design, and Fowler's enterprise application patterns.
part ofSoftware design & architectureoverview, primer and where to startread it →on this pageshowhide
explore
- Strategic Design40 questions
- Ubiquitous Language6 questions
- Subdomains: Core, Supporting, Generic6 questions
- Bounded Contexts6 questions
- Context Mapping6 questions
- Context Relationship Patterns5 questions
- Core Domain Distillation5 questions
- Event Storming & Collaborative Modeling6 questions
- Tactical Design53 questions
- Entities & Value Objects6 questions
- Aggregates5 questions
- Domain Events6 questions
- Domain Services6 questions
- Repositories (DDD)6 questions
- Factories (DDD)6 questions
- Specification Pattern6 questions
- Application vs Domain Services6 questions
- Supple Design6 questions
- Model-Driven Design29 questions
- Core MDD Principles6 questions
- MDA and Metamodels5 questions
- Model-to-Code Transformation6 questions
- Domain-Specific Languages6 questions
- Model-Code Alignment6 questions
- Application Architecture Patterns (PoEAA)52 questions
- Domain Logic Patterns5 questions
- Data Source Patterns6 questions
- Repository Pattern6 questions
- Unit of Work6 questions
- Object-Relational Mapping6 questions
- Integration Patterns6 questions
- Service Layer6 questions
- Data Transfer Object & Assembler5 questions
- Lazy Load6 questions
- Backend Developerroleanchors this topic
- Full Stack Developerroleanchors this topic
- Java Backend Developerroleanchors this topic
- Kotlin Backend Developerroleanchors this topic
- Software Design & Architectureskillanchors this topic
- Forward Deployed Engineerrole
- Game Developerrole
- Server-Side Game Developerrole
- Software Architectrole
questions
174 · 4 sectionsIn Domain-Driven Design, what is a bounded context, and why might the word 'Order' mean something different inside a company's Sales system than inside its Shipping system?
basics
~10 sA bounded context is a boundary around a part of a system where a specific model and its terms have one exact meaning. Outside that boundary, the same word can mean something completely different.
In Domain-Driven Design, what is a context map, and what three things does it typically show about a system made up of multiple bounded contexts?
basics
~10 sA context map is a diagram showing all the bounded contexts in a system, how they connect, which one leads (upstream) vs follows (downstream), and which teams own each one.
In Domain-Driven Design, what is an Anti-Corruption Layer (ACL), and why would a team put one between their bounded context and an external or legacy system?
basics
~10 sAn Anti-Corruption Layer is a translation wall between your code and someone else's system, so their messy or different data model doesn't leak into and pollute your own model.
In Domain-Driven Design, what is a Domain Vision Statement and why do teams write one when distilling the core domain?
basics
~10 sA domain vision statement is a short written description of the core domain, its value, and why it will make the product win — a compass for what's most important to build well.
A team runs a workshop where people write things on orange sticky notes in past tense (like 'Order Placed' or 'Payment Failed') and stick them on a long roll of paper in a rough timeline, with all the chairs removed from the room. What is this workshop technique called and what is its core mechanism?
basics
~20 sThis is Event Storming - a workshop where people from business and tech stand at a wall and write domain events (things that happened) on orange sticky notes in time order, to quickly build a shared picture of how a system or business process really works.
In Domain-Driven Design, what is an aggregate root, and why should code outside the aggregate hold a reference to it by ID rather than by object pointer?
basics
~20 sAn aggregate root is the single object outside code may touch inside a related cluster. Everything else is reached through it. Other code keeps just its ID, not a direct pointer, so it can't reach in and break the rules.
In a layered application built with Domain-Driven Design, what is the basic difference between an 'application service' and a 'domain service'?
basics
~20 sAn application service coordinates a use case — starts transactions, checks permissions, calls objects, converts data — without deciding business rules. A domain service holds business rules that don't fit one entity, like a rule spanning two accounts.
In Domain-Driven Design, what is a domain event, and why is it conventionally named in the past tense, like 'OrderShipped' rather than 'ShipOrder'?
basics
~20 sA domain event is a note that something meaningful already happened in the business, e.g. 'OrderShipped'. It's named in the past tense because it records a fact that occurred, not a request asking for something to happen.
In Domain-Driven Design, what is a Domain Service, and what's a simple example of when you'd need one instead of putting a method on an entity or value object?
basics
~20 sA Domain Service holds business logic that doesn't fit on one specific object. You use one when an operation needs several objects together, or is really an action rather than a 'thing' - like transferring money between two accounts.
In Domain-Driven Design, what is the core difference between an Entity and a Value Object, and why does that difference change how you implement equality checks (equals/hashCode) for each?
basics
~20 sAn Entity is something with its own identity that stays the same over time even if its details change — like a person has one ID for life. A Value Object has no identity of its own; it's just described by its data, so two Value Objects with the same data are treated as equal and interchangeable.
In Model-Driven Design, what does it mean to treat the model as the 'primary artifact' instead of treating diagrams as throwaway documentation?
basics
~20 sThe model isn't a picture you draw once and forget — it's the actual blueprint that the code, database, and APIs are built from and kept in sync with, so it stays accurate and useful as the system evolves.
In the context of Domain-Specific Languages (DSLs), what is the difference between an internal (embedded) DSL and an external (standalone) DSL, and can you give a concrete example of each?
basics
~20 sAn internal DSL is written using the normal syntax of an existing programming language, just arranged to read like a mini-language for one job (e.g. a Kotlin build script). An external DSL has its own custom syntax and needs its own parser to be understood, like SQL or a regular expression.
What is OMG's Model Driven Architecture (MDA), and what is the difference between a Platform-Independent Model (PIM) and a Platform-Specific Model (PSM)?
basics
~20 sMDA is a way of building software by first drawing a model of what the system does, ignoring the technology, then turning that model into one tied to a specific technology (like Java or a database), and finally generating code from it.
When keeping a UML or domain model in sync with running code, what is the difference between 'forward engineering' (generating code from a model) and 'reverse engineering' (deriving a model from existing code)?
basics
~20 sForward engineering writes the model first, then a tool generates code from it. Reverse engineering starts from existing code and builds or updates a model to describe it. Same goal—keep model and code matching—different starting point.
In model-driven development, one kind of transformation turns a model into working code or documentation, while another kind turns one model into a different model. What is the practical difference between these two kinds of transformations, and why does the choice matter for a real pipeline?
basics
~10 sModel-to-text turns a model into plain text, like source code, mostly a one-way trip. Model-to-model turns one structured model into another structured model, so it stays machine-readable and can be transformed again.
Application Architecture Patterns (PoEAA)
all 52 Application Architecture Patterns (PoEAA) questions →In Martin Fowler's data source architectural patterns, what is the Active Record pattern, and what two responsibilities does a single Active Record object combine into one class?
basics
~10 sActive Record is a design where one class both holds the data fields of a database row (like name, price) and has methods to save, load, and delete itself from that row's table.
What is the Transaction Script pattern for organizing business logic, and what does a single script typically do?
basics
~20 sA Transaction Script is one procedure that handles a single business request end to end: it reads input, runs the rules step by step, talks to the database, and returns a result. No shared object model, just a top-to-bottom recipe per action.
What is a Data Transfer Object (DTO), and why would a service return a DTO instead of directly serializing its internal domain or persistence entity objects to a client?
basics
~20 sA DTO is a plain object built just to carry data across a boundary, like a network call. Services return DTOs instead of internal objects so clients don't depend on internal details that might change, break, or leak sensitive data.
In enterprise integration, three common message types are commands, events, and queries. What distinguishes them, and how does each affect coupling between sender and receiver?
basics
~20 sA command tells one system to do something specific, like 'ship this order.' An event announces that something already happened, like 'order shipped,' and anyone can listen. A query just asks for data without changing anything. Each creates a different kind of dependency between sender and receiver.
In plain terms, what is the Lazy Load pattern, and why would a system delay loading an object's data instead of fetching everything up front?
basics
~20 sLazy Load means you don't fetch data until you actually need it. Instead of loading a whole object graph at once (which can be slow and wasteful), you load the minimum needed now and fetch the rest later, only if code actually asks for it.