TLC #15: Domain-driven Design 101

In the second post on the theme "designing better software solutions", let's talk about domain-driven design (Issue #15, 16 Jun 2024)

Hey, Ashwin here! Welcome to edition #15 of the Tech Lead Compass newsletter!

Software systems don’t exist in a vacuum. They solve business problems and add value to the domain they operate in.

Then it is a no-brainer that software system design must be aligned to the business environment. Domain-driven design, commonly known as DDD, is a way to do this.


What is Domain-driven Design?

Domain-Driven Design (DDD) is a software design approach that focuses on creating software based on the core domain and domain logic of a business.

It emphasizes collaboration between technical and business teams to create a shared understanding of the problem domain.

What is a Domain?

A domain is the specific area of business or knowledge that the software is designed to address. It encompasses the language, rules, and processes that govern a particular area.

For example, in an e-commerce application, the domain would include concepts like products, orders, customers, and payments.

Key Tenets of DDD

Here are some fundamental aspects of DDD that are essential to understand.

Ubiquitous Language

DDD promotes the use of a ubiquitous language, which is a common language shared by both the business and technical teams. This language is based on the domain model and is used consistently throughout the project, including in the code, documentation, and conversations.

By using a ubiquitous language, everyone involved in the project can communicate more effectively and reduce misunderstandings.

Bounded Contexts

In a complex domain, it’s common to have multiple subdomains or contexts.

Bounded contexts are used to define the boundaries of each subdomain and ensure that each context has a clear and consistent model. This helps to manage complexity and reduce the risk of inconsistencies across the system.

Entities, Value Objects, and Aggregates

DDD introduces several key concepts for modeling the domain:

  • Entities: Objects that have a unique identity and can change over time
  • Value Objects: Objects that are defined by their value and are immutable
  • Aggregates: Clusters of entities and value objects that are treated as a single unit

These concepts help to create a more accurate and consistent representation of the domain in the software.

Domain Events

Domain events are significant occurrences within the domain that are of interest to the business. By modeling and handling these events, the software can better reflect the real-world behavior of the domain.

Layers

DDD suggests organizing the software into layers, such as the presentation layer, application layer, domain layer, and infrastructure layer. This separation of concerns helps to keep the domain model clean and independent of technical details.

Representing DDD

DDD is an approach to design systems, so it doesn’t prescribe specific ways of description. You won’t find a DDD diagram anywhere.

However, the C4 diagrams that we discussed in the last edition – especially System Context and Container diagrams are useful for modeling a domain-driven design.

In summary, Domain-Driven Design is a powerful approach for creating software that closely aligns with the business domain.

Now on to the must-read news from the past week…


5 “Must-Read” Tech News for the Week

  1. Apple’s WWDC 2024 was all about AI (Apple)

Apple announced “Apple Intelligence”, which refers to AI running on its chips and devices. All new OS (iOS 18, iPadOS18, macOS Sequoia, and watchOS 11) and software announcements for Apple devices revolve around its Apple intelligence. Also Apple Vision Pro is rolling into new markets.

  1. Microsoft reportedly building an internal rival to OpenAI, led by Mustafa Suleyman (WSJ)

Partnership with OpenAI appears to be just the first step in Microsoft’s AI journey. Mustafa Suleyman who was hired a few months back to lead the AI division, is building an internal AI platform that will progressively replace OpenAI’s use and establish self-reliance.

  1. Oracle’s advertising business bites the dust (Adweek)

Oracle is shutting down its advertising business after revenue declined from $2 billion in 2022 to only $300 million in fiscal year 2024

  1. Video calling on WhatsApp gets a major boost (Techcrunch)

Video calls on WhatsApp are getting better with screen sharing, increased participant limit, speaker spotlight, and better codec. It is slowly getting into the space currently occupied by video calling software like Zoom and Google Meet. Can it take a good chunk of their market share?

  1. Databricks launches AI/BI, an intelligent data analytics tool (Databricks)

Databricks has introduced AI/BI, a new business intelligence product that uses a compound AI system to deeply understand data semantics and enable self-service analytics

It has 2 major components: AI/BI dashboard which is a low-code dashboarding solution and Genie, a conversational interface to query data using natural language.

That’s it for the week!


Are you a tech leader looking to connect with like-minded leaders, learn from them, and grow your network and career?

We launched a free, invite-only community for and run by tech leaders – TLC Tech Lead Mastermind Community. Click the link below to join. Looking forward to seeing you on the other side.

Join the TLC Mastermind Community

Leave a Reply