Best of Dependency InjectionMay 2025

  1. 1
    Article
    Avatar of milanjovanovicMilan Jovanović·1y

    CQRS Pattern the Way It Should've Been From the Start

    This post explains how to implement CQRS in .NET without relying on MediatR, providing a guide for building a lightweight setup using simple interfaces, decorators, and dependency injection. Explore the benefits such as better control over CQRS infrastructure, predictable dispatching, simplified debugging, and improved testability. Learn how to define command and query interfaces, add decorators for logging and validation, and register everything using Scrutor for a clean and extensible CQRS pipeline.

  2. 2
    Article
    Avatar of tomasvotrubaTomas Votruba·1y

    The Patch for Laravel Container

    The post discusses patching the Laravel Container to optimize performance by ensuring services are treated as singletons rather than being instantiated multiple times. The suggested approach avoids extensive configuration by modifying a single line of code in the Laravel container file. The article highlights the benefits of using patches stored in an open-source repository to simplify the process across projects.