Domain Driven Design in AI-Driven Era
By Bhuvaneswari Subramani / Feb 20, 2025
From the very start of my career, I’ve been deeply involved in product development, beginning with building B2B sites and GIS & GPS-based desktop and web applications in the early 2000s. I then had the incredible opportunity to contribute to the development and scaling of Business Intelligence and Data Management solutions. My journey continued as I worked on ERP and CRM products, culminating in my role with Infor’s Supply Chain Product suite.
These rich experiences in product development, combined with my current role in premium engineering solution consulting at Intuitive.Cloud, have provided me with invaluable insights. Now, I am eager to leverage my expertise and thought leadership to re-examine Domain-Driven Design.
Gone are those days where only the hand-picked teams like core engineering team, product management team need to have deeper knowledge about the software development methodologies and others can have an overview.
While we are marching towards AI-Driven world, you will be leveraging AI’s ability in task decomposition, and decision-making processes, developers will be empowered to transcend traditional specialization silos such as infrastructure, front-end, back-end, DevOps, and security. Let’s call them as AI-Native Trailblazers and as a pre-cursor to the AI-Driven development, bringing the Domain Driven Design blog to the AI-Native Trailblazers to have a perspective to the software development methodology.
Domain Driven Design Definition
Domain Driven Design Definition
Let’s break down Domain-Driven Design (DDD) in a simple and intuitive way
Imagine you’re building a car rental service to automate the process of renting cars to customers. The product design would fit in to the below template (considering car rental scenario only).
Domain Driven Design Example
Here are the key ideas:
-
Focus on the Core Domain: Identify the most important part of your application (the core domain) and give it the most attention.
Example: The core domain of a car rental service is renting cars to customers, so we focus on making this process efficient and effective. -
Ubiquitous Language: Create a common language that everyone (Technical, Business, users) uses to describe the domain. It ensures that everyone has a clear and consistent understanding of the domain concepts.
Example: The common terms here are Vehicles, Customer, Payment -
Bounded Contexts: Divide the application into distinct sections (bounded contexts), each with its own specific rules and responsibilities.
Example: In a car rental service, you can have separate bounded contexts for customer management, vehicle management, and rental processing. -
Entities and Value Objects: Entities are the key objects in your domain. Entities are like customer entity have a unique Customer ID and Vehicle entity has unique Vehicle ID, while value objects are objects that describe some characteristics but don’t have a unique identity.
Objects that have a unique identity and lifecycle.
Example: a Customer entity has a unique customer ID. -
Aggregates: Group related entities and value objects together to form aggregates, ensuring they work as a cohesive unit.
Aggregates are groups of related entities and value objects that are treated as a single unit.
Example: a Rental Agreement aggregate might include:
— The Customer who is renting the car.
— The Vehicle being rented.
— The Rental Period.
— The Payment Details. -
Repositories: Create repositories to manage the storage and retrieval of aggregates. Think of these as city archives where important documents and records are kept.
Example: a Rental Agreement Repository would handle saving and retrieving rental agreements from the database. -
Services:Services encapsulate the domain logic that does not fit naturally within an entity or value object and performs the operations that involve multiple entities or aggregates.
Example: a ReservationService handles the business logic for creating, updating, and canceling reservations. -
Factories: Factories encapsulate the creation logic for complex objects to ensure that they are created correctly and creates instances of aggregates or entities, particularly when the creation proess is complex.
Example: a ReservationFactory handle the creation of Reservation aggregates, ensuring all necessary components are correctly instantiated.
Let’s represent the bounded contexts, entities, value objects, aggregates and repository visually to get the mapping better.
High cohesion and Low coupling
I would like to introduce two new essential principles in Domain Driven Design, High cohesion and Low coupling, which helps to create a well-structured and maintainable domain model.
High Cohession in DDD: In DDD, high cohesion means that each part of the domain model (e.g., entities, value objects, aggregates) has a clear and focused responsibility.
Example: a Customer entity in a car rental system should only handle customer-related information and behavior.
Low Coupling in DDD: In DDD, low coupling means that different parts of the domain model interact with each other through well-defined interfaces, minimizing dependencies.
Example: the Reservation Management context in a car rental system is separate from the Customer Management context, and they interact through well-defined interfaces.
By adhering to the principles of high cohesion and low coupling, DDD helps create a robust and maintainable domain model that aligns closely with the business needs and processes.
Next steps after Domain Model is built
Once you have the core Domain Design in-place, you can Logic
After Domain Design,
- Logical Design: To meet the non-functional requirements
- Implementation: Where you start writing actual code based on the design and write unit tests.
- Integration: Integrate different components and modules of the application to ensure that they work seamlessly and perform integration tests.
- User Interface (UI) Development: Design the user interface based on the requirements and User Experience(UX) design, develop the front-end components and integrate them with back-end services.
- Database Design and implementation: Design the databses schema based on the domain model, define tables, relationships, indexes and constraints. Create the database and implement the schema and pre-populate with initial dataset, as applicable.
- Deployment: Prepare the Infrastructure as Code (IaC) including servers, cloud services, networking with firewall and deploy the application as Dev, Test and Prod environments. Ensure that all components are configured correctly.
- Quality Assurance: Carry out Functional, Performance and Security testing to ensure that the application meets funtional requirements, dynamic load and free from security vulnerabilities.
- Monitoring and Maintenance: Setup the monitoring tools to track the application for its performance, availability and errors. Ensure that periodic updates with the bug fixes, improve performance and feature enhancements are sent to all applicable environments.
- Documentation: Document the application, infrastructure code, architecture, design decisions and create user manuals and guides to help users understand how to use the application.
In summary,by using Domain-Driven Design, you ensure that your application is well-organized, with clear boundaries and a shared understanding among everyone involved. In the AI-Driven era, where the AI-Native Trailblazer is going to work with AI-System to design, develop and deploy an end-end-end application. Hence having a deeper understanding of software development practices like Domain-Driven Design, makes it easier to manage complexity and build a robust, scalable system.
Connect with me on linkedin or Intuitive.Cloud to fast-track your product development with AI-Driven method, migration or modernization as brown-field or green-field customer in your journey to AWS Cloud.