Skip to content

ASP.NET Core Enterprise Applications

Jeferson Almeida edited this page Oct 5, 2024 · 5 revisions

Welcome to the aspnet-core-enterprise-application wiki!

Developing project for large-scale, low-latency applications


DDD Domain-driven design (DDD) is a software development methodology that focuses on understanding and modeling a business domain to improve the quality of software. DDD is particularly useful for complex domains where a lot of logic needs to be organized.

Here are some key aspects of DDD:

  • Domain models DDD helps developers create domain models, which are software abstractions that encapsulate complex business logic.

  • Bounded contexts DDD divides large systems into bounded contexts, each with its own model.

  • Collaboration DDD encourages collaboration between technical and domain experts to refine a conceptual model.

  • Code structure The structure and language of software code should match the business domain.

  • Benefits DDD can lead to better application balance and cleaner, more reliable code.

_The name DDD comes from a 2003 book by Eric Evans that introduced the notion of classifying objects into entities, value objects, and service objects.


IAggregateRoot In .NET, the IAggregateRoot interface is used to indicate that a class entity is an aggregate root:

  • What is an aggregate root? In Domain-Driven Design (DDD), an aggregate root is an entity that acts as a focal point for a cluster of related entities and value objects.

  • What is the IAggregateRoot interface? The IAggregateRoot interface is an empty interface, also known as a marker interface, that's used to indicate that a class entity is an aggregate root.

  • Why use the IAggregateRoot interface? The IAggregateRoot interface is a simple way to mark a class, especially when the interface might be evolving.

  • What does an aggregate root do? An aggregate root's main objective is to maintain consistency. For example, if an Order entity has a collection of OrderItem entities, the Order is the aggregate root. The aggregate root class must keep control and consistency of any update operation against its child entities.


Delegating Handlers Delegating handlers are cousins of asp.net core middleware. Lets talk a bit about middlewares, this will help us understand delegating handler easy.

A middleware resides in the asp.net core application that accepts http requests. The Http request flows into the first middleware and if it wants passes on the request to the next. Until, there is a middleware the creates a response and the response flows back from the middleware that generated the response up until the first middleware. Finally the response is sent back to the client that actually made the http request over the network.

Delegating handlers are similar to middlewares but on the client side. So, if you are making a http request using the httpClient you can leverage delegating handlers.

Clone this wiki locally