← Back to Blog

Dec 1, 2026

Three Tables That Take You from CRUD to DDD

An introduction to three practical tables — the entity behavior table, the domain context table, and the domain service capability table — that help you move from a CRUD mindset to DDD domain modeling, with a full HR system worked example.

DDD Domain ModelingDDDEntity Behavior TableDomain ContextDomain Service CapabilityCRUDModeling Methods

1. Background

Recently my department took over part of the product center and inventory center services. We are currently sorting out the related business processes, code, and business models. I also tried writing two domain service capability model assessment documents for inventory and products from a domain design perspective, and in them I drew a few tables to express business entities, their behaviors, and the contexts they belong to. These three tables turned out to be very useful, so here is a dedicated article explaining them.

2. Perspectives on Requirements

2.1 The CRUD Business Perspective

When analyzing product requirements, many developers break the requirement down into tasks, interfaces, and data models, map them onto CRUD, and then work out the interfaces the module needs. Interface naming almost always carries a CRUD marker. On the other hand, behind CRUD is nothing more than operating on the data model — in other words, CRUD is the pattern used to explain how a business model translates into a data model.

2.2 The DDD Business Perspective

Looking at product requirements from a DDD business perspective, you do not start from those details, and the CRUD operations inside a split-out module are not strictly necessary. Some modules have no enable/disable at all, some only have create and query. DDD pays more attention to how the business models in a requirement are expressed and organized, and to how they change across iterations. In addition, entities and models under DDD carry behaviors, and those behaviors are the business activities the requirement is meant to implement. So from a DDD business perspective, a requirement is not just CRUD — it is the business behavior of the model.

2.3 The Business Development Perspective

When you use a common or traditional approach to breaking down requirements, you always end up putting a table or a set of related features together and calling it a package or a module. From the package point of view, CRUD-style and DDD-style development are similar. But in a CRUD-style system, a module is generally one table and one service, or it manages several services of the same type. In a DDD-style system, the packaging strategy can vary endlessly: it can accommodate the CRUD-style module layout, but it can also split by context, by aggregate root, or by type, and then further into submodules and subpackages.

So in terms of breaking work down into tasks and features, requirements can be divided into large modules and small features and laid out as a list. From a DDD point of view, you start from entity behaviors instead, and divide module features and packages from there.

3. The Three Tables

These three tables were inspired by an article I read earlier and are now put to work in real projects. I find them a very good fit for expressing domain entities and contexts, and I have adjusted them a bit. You can use them to analyze business models from a domain design perspective when starting a new project or when analyzing an existing system. Below, let’s look at the tables through a domain analysis of an HR system.

3.1 Entity Behavior Table

From an HR system I worked on before, I sorted out the following business entities:

Employee, Department, Position, Salary, Work Experience, Education Background, Contract Agreement, Emergency Contact, Benefits, Probation Application Form, Resignation Application Form, Resignation Handover Form, Data Field Permission Configuration.

Now let’s see, from a domain context point of view, how these business entities divide into business domains and contexts.

Business Entity Domain Context Core Elements (Value Objects) or Core Attributes Notes
Employee Employee domain Employee basic information Avatar, name, department, email
Work experience Employee domain Employee extended information Employer name, start date, end date
Education background Employee domain Employee extended information School name, start date, end date
Emergency contact Employee domain Employee extended information Contact phone, relationship, contact order
Department Organization domain Department Department name, level, administrator, parent department ID
Position Organization domain Position Position name, description, level
Contract agreement Employee domain Employee extended information Contract name, type, content, variables
Resignation application Business process domain Resignation application Applicant, application date, reason for resignation
Probation application Business process domain Probation application Applicant, application date, work summary
Resignation handover Business process domain Resignation handover Handover items, order, approver, handover content
Data field permission configuration Common configuration domain In-system permissions Table name, table description, field name, field description, employee data permission description
Administrator permission configuration Common configuration domain In-system permissions Business line, administrator list, feature list
Business reminder configuration Common configuration domain Business configuration Configuration name, parameters, description, grouping type
Benefits Employee domain Employee extended information Social insurance contribution base
Salary Employee domain Employee extended information Monthly salary, annual salary

3.2 Domain Context Table

Business Domain Business Context Business Behaviors
Employee domain Employee basic information Maintain, export, import, page, and archive employee information
Employee domain Employee extended information Maintain work experience, education background, and emergency contacts; manage, sign, page, renew, export, preview, and download contracts; maintain salary and benefits
Organization domain Departments, positions, DingTalk organizational relationships Maintain and export department information, view the org tree, adjust departments, manage positions
Business process domain Resignation, probation, position change Resignation application, resignation approval, resignation handover flow management, probation application flow management
Common configuration domain In-system permissions Configure super admins and HR admins per business line; probation, department adjustment, and information completeness reminders

3.3 Domain Service Capability Table

Business Domain Business Context Service Capability Business Description
Employee domain Employee basic information, employee extended information Manage and maintain employee basic and extended information
Organization domain Departments, positions, DingTalk organizational relationships Maintain departments, positions, and DingTalk organizational relationships
Business process domain Resignation, probation, position change Manage business processes such as employee transfers, joining, and leaving
Common configuration domain In-system permissions, copy, reminders Manage in-system permissions, reminder configuration, and copy configuration

4. Summary

As things stand, these three tables have both strengths and weaknesses.

4.1 Strengths

  1. They express business entities and their domain contexts completely.
  2. They extend outward into domain business behaviors, which translate into interfaces and aggregate roots.
  3. They make modeling a system straightforward.

4.2 Weaknesses

  1. Relationships between contexts are not visible directly.
  2. Relationships between different domains in the system are not visible directly.
  3. Getting from a business entity model to a data table model still needs further work.

4.3 Usage

These three tables are documentation, so they need to be combined with other diagrams to describe relationships between contexts — a context map, or the cracked-egg style domain context diagram from earlier, works well. If you really put them into use, you can extend the tables and put related table names and fields at the back as a documentation reference.

All three tables are quite useful as they stand. I have already used them in the product, inventory, and HR systems.

Comments

Comments are powered by GitHub Discussions. Sign in with GitHub to join the discussion.