
Published: 28 April 2025
Known Uses
The Data Element pattern is widely used and ubiquitous. This message-level pattern is primarily used in requests and responses and applied in the construction or API design phase.
Discussion Input
The pattern is closely tied to the principle of loose coupling. The pattern addresses the problem that domain model components used for API implementation should not be exposed directly. Instead, they should be encapsulated or mapped in a way that ensures separation between the internal workings of the system and the API’s external interface. By doing so, we achieve loose coupling between the client, the interface, and the implementation. This approach allows for greater flexibility and stability: while the API speaks the Published Language (PL), it remains decoupled from the internal domain model and Ubiquitous Language (UL) of a Bounded Context. This separation ensures that changes in the internal domain language do not impact the external interface.
Loose coupling also ties into the concept of data minimization. APIs should avoid returning large amounts of data in responses. Whenever possible, only the relevant fields or subsets of data needed by the user or application should be returned. For larger datasets, pagination should be implemented. The book proposes principles such as ‘less is more’ and ‘if in doubt, leave it out’ as useful guidelines for defining secure data contracts in APIs. This is in line with OWASP’s security best practices, which recommend minimizing the exposure of unnecessary or sensitive data in APIs to reduce security risks. Designing APIs with a minimalist mindset is crucial. Simplicity is key in the world of APIs.
It’s often easier to add new data elements or attributes than to remove them later. However, as more data elements are added, the need for patterns like the ‘Wish List’ pattern increases. This pattern helps maintain a balance between data parsimony and flexibility. In this context, we have adopted the German word Datensparsamskeit (data parsimony) and would like to add: ‘In der Beschränkung zeigt sich der Meister.’ Both advocate for the elegance and efficiency of minimalism.
Recommended Reading
Published language and Industry Standards in DDD (also shares experiences in the attempt to define a dedicated vocabulary, resulting in an enterprise-grade Canonical Data Model and all the challenges that come with it)

Read the complete pattern on api-patterns.org