Learn about .NET 8, Blazor, Cloud Native, #dotNETMAUI, and more at .NET Conf 2023 West TN Region on January 05 in Namakkal, India! https://t.co/CB76tDdeix
Discover #dotNETConf local events happening around the world at https://t.co/X6ngtYFCQX #community
Just extended another year for Microsoft Certified: Azure Administrator Associate and it was only then I discovered Microsoft has renamed AzureAD to Entra ID.
I spent 4 years studying Domain-Driven Design, so you don't have to.
Here are the 9 most important DDD patterns. ๐
1. Bounded Contexts
Instead of having one large and complex domain - you split it into smaller, more manageable parts.
Each part has its distinct model and boundaries.
Bounded contexts prevent conflicts and confusion by isolating different parts of the domain.
2. Anti-Corruption Layer:
Protects a bounded context from outside influence. These can be external systems or domains that use different models.
It ensures that the internal model remains clean and unaffected.
3. Entities
An entity in the domain:
- Has a distinct identity
- Can change over time
Entities are the core building blocks of a domain model.
4. Value Objects
Value objects:
- Immutable
- No distinct identity
- Represented by values
We use Value objects to model properties of entities or other domain concepts.
5. Aggregates
Aggregates group related entities and value objects into a single unit of consistency.
The root entity is a gateway to access and change the objects inside.
Its purpose is to maintain data consistency within a bounded context.
6. Domain events
Domain events represent significant state changes within the domain.
They communicate changes and trigger actions within the application or between bounded contexts.
Important: naming in past tense.
7. Factories
Factories are responsible for creating complex domain objects.
They encapsulate the logic required to create these objects and ensure they are in a valid state.
8. Services
Domain services encapsulate domain logic that doesn't belong to any entities (or value objects).
They are stateless and operate on the domain model to perform specific tasks.
9. Repositories
Repositories provide a way to access and manage aggregates (or entities).
They are a bridge between the application code and the data storage - allowing for a domain-centric approach to data access.
P.S. If you liked this, consider joining The .NET Weekly - my newsletter with 27,000+ engineers that teaches you how to improve at .NET and software architecture.
Subscribe here โ https://t.co/dCEi48iXpl
Which DDD pattern do you use most often?
Very proud of my team! Announcing the release of the new Foundational C# Certification in collaboration with @freeCodeCamp. The cert is completely free, globally available, and includes a full 35-hour C# course on Microsoft Learn. Get started at https://t.co/vb7RLFSHCz itโs FREE!
Iโve a week and a half to create a POC using Microsoft Orleans 7, attempting to explain and to proof why using an actor is an excellent fit for solving a particular business problem
Debugging https://t.co/vykcBhgNKZ Core apps is easier in .NET 8. We've added debug visualizers for commonly used types: HttpContext, HttpRequest, HttpResponse, etc.
Check it out in the latest .NET 8 preview ๐
https://t.co/B5Nt1ov5Px