- read

Practical DDD in TypeScript: Module

Marko Milojevic 70

Photo by Alain Pham on Unsplash

When we think about Design Patterns, without a mistake, we point to some code structure, that more or less defines some good practice in software development. One rule is — it must contain some code example.

Many would not consider the Module pattern as an actual pattern, not in a conventional way. It is understandable, as someone may think more about a Module as a project structure than a pattern.

Other articles from DDD series:

1. Practical DDD in TypeScript: Why Is It Important?

2. Practical DDD in TypeScript: Value Object

3. Practical DDD in TypeScript: Entity

4. Practical DDD in TypeScript: Domain Service

5. Practical DDD in TypeScript: Domain Event

Additional troubles come when we consider NodeJS Modules. They are coupled collections of code written in JavaScript and TypeScript, versioned, and released together.

The trouble is how to connect that story now with the Module pattern in the Domain-Driven Design. Is there a sense at all to do such a thing or we can live without this pattern?

Disclaimer: Effective September 1st, 2023, the referral system on Medium
is no longer operational. If you appreciate this DDD series and would
like to endorse the efforts of both myself and fellow authors on Medium,
kindly demonstrate your support through claps, follows, or comments on
our blogs. Your consideration is greatly appreciated. Thank you in advance!

As with any other pattern from Domain-Driven Design, even Module has its examples in day-to-day use in software development. Naturally, that use may differ from other languages, but the main idea is still there.

Let us examine that idea.

The Structure