Domain Modeling for Humans and AI

4 hours, 35 minutes CC
Domain Modeling for Humans and AI

Course Description

Master Domain-Driven Design and bridge the communication gap between users, product managers, and AI. Leverage TypeScript to model entities, value objects, aggregates and bounded contexts. Apply systems thinking to analyze how complex systems relate and constrain each other. Future-proof your systems for AI-assisted development by architecting well-defined domains for effective collaboration with LLMs and agentic coding tools. Develop the shared language and collaboration skills that distinguish senior developers and architects from purely technical contributors.

This course and others like it are available as part of our Frontend Masters video subscription.

Preview
Close

Course Details

Published: September 15, 2025

Learn Straight from the Experts Who Shape the Modern Web

Your Path to Senior Developer and Beyond
  • 250+ In-depth courses
  • 18 Learning Paths
  • Industry Leading Experts
  • Live Interactive Workshops

Table of Contents

Introduction

Section Duration: 11 minutes
  • Introduction
    Mike North introduces the course by discussing domain modeling, focusing on translating complex business problems into manageable units of code that can evolve easily. The course explores domain-driven design concepts and practical application through a gardening software example, demonstrating how to model business rules and contain complexity.

Value Objects & Entities

Section Duration: 1 hour, 40 minutes

Conversations with Domain Experts

Section Duration: 1 hour, 5 minutes
  • Collaborating with Domain Experts
    Mike discusses building a shared vocabulary with domain experts to improve collaboration. He suggests using visuals, asking open questions, documenting details, and seeking examples to ensure clarity. He also highlights the need to iterate, validate, and summarize concepts to maintain understanding.
  • Domain Expert Interview Exercise
    Mike introduces an exercise for students to practice identifying core values and avoid unnecessary details. He encourages focusing on building useful software rather than perfectly replicating reality. The discussion covers seed lifecycles, time-based actions, expiration, and reminders for effective seed management.
  • Diagramming Domain Expert Models
    Mike explains how to model plant stages and durations as a value object, using clear names like "plant stage." He focuses on essential seed packet data like time durations and start dates to keep the model user-friendly and relevant.
  • Implementing Seed Domain
    Mike implements the seed packet model by adding fields like days to harvest, planting distance, and expiration date. He updates backend entities, ensures proper data flow, and addresses data representation, persistence, and UI integration.
  • Seed Packet UI
    Mike adds a UI for the back of a seed packet, including planting distance and validation. He converts distances to feet to match the API, adjusts data structures, and uses helpers to keep data consistent.

Bounded Contexts & Domain Modeling

Section Duration: 57 minutes
  • Bounded Contexts
    Mike explains bounded contexts as distinct areas with shared language and consistency. In a gardening app, this means separating plant data from UI elements like grids. He also introduces an anti-corruption layer to keep communication clean between contexts.
  • Contexts Diagramming Exercise
    Mike introduces a domain modeling exercise for a gardening app, focusing on raised beds, plant layouts, and spacing. He defines key entities like gardens, beds, and plants, stressing the need to capture essential elements like positioning and relationships. He also covers seed packets, plant metadata, and future ideas like plant cooperation.
  • Implementing Garden Domain Models
    Mike walks through the implementation of the garden domain models by creating types and entities in the source folder. He focuses on building a workspace schema with zones, item placements, and garden metadata.
  • Modeling the Server Side of Plant
    Mike adds a garden bed entity to the server-side model, sets up relationships, and includes width and height. He creates and saves a bed, resolves property errors, updates routing, and handles type issues, showing the iterative process of expanding the app.
  • Modeling Plant Placement
    Mike models plants by linking seed packets, plants, and their positions in a bed. He stresses accurate domain modeling, updates code to reflect this, disables redundant code, adjusts relationships, and ensures proper data persistence.

Validation & Aggregates

Section Duration: 40 minutes
  • Client Validation Rules
    Mike works with the ddd-client-validation(START?) branch, focusing on business rules in the workspace controller. He implements validation for item placement, removal, and movement, returning errors as values instead of throwing them. He also enforces rules like boundary checks and preventing overlaps within the context.
  • Modeling New Validation Rules
    Mike briefly discusses planting rules like staying in bounds, avoiding overlaps, and limiting beds to 80% full. He then creates a validation to prevent harmful plants from being adjacent, highlighting the need for clear validation logic to support testing and modular code.
  • Aggregates
    Mike explains aggregates as a way to keep related data consistent in complex systems. He shows how setting clear boundaries helps make sure updates happen together safely. Using the garden example, he demonstrates how picking the right group of data helps keep things reliable, even if other parts of the system aren't perfectly in sync.

Wrapping Up

Section Duration:
  • Wrapping Up
    Mike wraps up the course by stressing the value of domain modeling and clear communication with users. Shared language helps developers solve real problems and avoid unnecessary complexity.

Learn Straight from the Experts Who Shape the Modern Web

  • In-depth Courses
  • Industry Leading Experts
  • Learning Paths
  • Live Interactive Workshops
Get Unlimited Access Now