Best of Dependency Injection2024

  1. 1
    Video
    Avatar of communityCommunity Picks·2y

    Implement Clean Architecture in Next.js

    Clean architecture, a concept developed by Robert Martin, integrates various software architectures like hexagonal, onion, and others into a cohesive framework. It focuses on ensuring that the business logic of an application remains independent of frameworks, UI, databases, and external agencies. The post discusses implementing clean architecture in a Next.js application, highlighting the importance of separating different concerns through layers. It explains how to structure code to make applications more testable and maintainable. Key aspects include dependency injection, unit testing, and the interaction between different architectural layers.

  2. 2
    Article
    Avatar of medium_jsMedium·2y

    The Essential Node.js Guide for Developers of All Levels

    This post provides essential Node.js best practices for developers at all levels. It covers application architecture, code-level practices, performance optimization tips, security tips, and scalability strategies.

  3. 3
    Article
    Avatar of communityCommunity Picks·2y

    Dependency Injection made simple.

    Dependency Injection simplifies handling dependent objects, making code more flexible and decoupled. In JavaScript, passing connection objects through constructors exemplifies this. For strongly typed languages like C# and Java, interfaces help enforce consistent structures. This approach enhances code management and testing.

  4. 4
    Article
    Avatar of milanjovanovicMilan Jovanović·2y

    Building Your First Use Case With Clean Architecture

    Learn how to design a user registration feature using Clean Architecture principles, focusing on the dependency rule to decouple business logic from external dependencies. Clean Architecture emphasizes separation of concerns, making systems more maintainable and testable. The practical guide covers defining use cases, managing dependencies, handling race conditions, and updating hashing algorithms.

  5. 5
    Article
    Avatar of mwaseemzakirWaseem .NET Newsletter·2y

    EP 62 : Dependency Injection Explained in .NET

    Dependency injection is a programming technique in which an object receives other required objects instead of creating them internally. Benefits of dependency injection include automatic handling of object creation and disposal, easy unit testing, and adaptability to changes without affecting existing code. Dependency injection can be implemented using the singleton, transient, or scoped approach.

  6. 6
    Article
    Avatar of medium_jsMedium·2y

    Kotlin MultiPlatform (KMP)

    Learn about setting up the environment for Kotlin MultiPlatform development, the structure of a KMM project, and using coroutines in iOS.

  7. 7
    Article
    Avatar of javarevisitedJavarevisited·2y

    Understanding Spring Core: The Foundation of Spring Framework

    The post explores the importance of the Spring Core Module in the Spring Framework, including the concept of Spring containers and Spring beans. It discusses the role of containers in managing the lifecycle and dependencies of beans and explains why they are called IoC containers. The post also covers different types of dependency injection techniques used in Spring.

  8. 8
    Article
    Avatar of towardsdevTowards Dev·2y

    Improving Factory Pattern using DI in .Net

    This post discusses how to improve the Factory Pattern using Dependency Injection in .Net 5. It explains the concept of the Factory Pattern and demonstrates how dependency injection can be used to enhance it.

  9. 9
    Article
    Avatar of javarevisitedJavarevisited·2y

    Review Spring Framework

    The Spring Framework uses Inversion of Control (IOC) to manage the control flow and object dependencies through mechanisms like dependency injection. The IOC container in Spring is represented by the Application Context, which manages the lifecycle of beans. Bean Factory and Application Context are two types of IOC containers, with the latter offering extended functionalities. Spring beans have different scopes such as Singleton, Prototype, Request, Session, and Application, each serving distinct use cases. The framework also supports various annotations for configuration and dependency management, and it allows the modularization of concerns via Aspect-Oriented Programming (AOP).

  10. 10
    Video
    Avatar of codeheimcodeHeim·2y

    #41 Golang - Master Dependency Injection in Go

    Learn about dependency injection in Go and how it can make code easier to change and test. See how to implement dependency injection using interfaces and structures. Explore a bakery example to understand the concept.

  11. 11
    Article
    Avatar of communityCommunity Picks·2y

    Applying Clean Architecture in Go

    Clean Architecture focuses on decoupling code and making it easier to make changes in the future. It separates the application into layers and focuses on the domain model. The implementation of the Blog project using Clean Architecture is described, and the benefits of using this approach are highlighted.

  12. 12
    Article
    Avatar of jsPlainEnglishJavaScript in Plain English·2y

    How Using Angular’s inject() Function Has Saved Me 1000 Lines of Code

    The inject() function in Angular allows for cleaner and more readable code by injecting dependencies in a different way than using constructors. It also provides better inheritance capabilities and can lead to significant reduction in lines of code.

  13. 13
    Article
    Avatar of csharpcornerC# Corner·2y

    Strategy Pattern in .NET 8.0 Minimal API with Dependency Injection

    Explore how to implement the Strategy pattern in .NET 8.0 using Minimal API and dependency injection. Learn to create a flexible and maintainable payment processing system by encapsulating multiple payment method algorithms, defining a strategy interface, implementing concrete strategies, setting up payment context, configuring the Minimal API with dependency injection, and testing the endpoint.

  14. 14
    Article
    Avatar of justjavaJust Java·2y

    Java & Spring Best Practices | Dependency Injection

    New GitHub repository 'java-spring-best-practices' launched, focusing on Java and Spring best practices through practical code snippets. The first module covers Dependency Injection, highlighting constructor injection for better immutability and testability. Contributions to the repository are encouraged.

  15. 15
    Article
    Avatar of justjavaJust Java·2y

    Java Spring Boot for Beginners | Part 3 : Dependency Injection and Components

    Discover how Dependency Injection and IoC containers in Java Spring Boot can help make your code cleaner and more efficient. The tutorial provides an in-depth explanation of these concepts for beginners.

  16. 16
    Article
    Avatar of communityCommunity Picks·2y

    Dependency Injection

    Dependency Injection (DI) is a style of object configuration where an external entity sets an object's fields and collaborators. This helps in making the object more flexible and testable. The provided example demonstrates how to decouple a class from its dependencies by injecting them via constructors, improving maintainability. The concept is extended through layers of the application to enhance modularity.

  17. 17
    Article
    Avatar of medium_jsMedium·2y

    Modern Android Development in 2024

    This post discusses various topics related to modern Android development in 2024, including the use of Kotlin, key features of Jetpack Compose, architecture patterns, dependency injection, modularization, testing, in-app updates and reviews, security, loggers, Google Play Instant, AI coding assistants, and Kotlin Multiplatform.

  18. 18
    Article
    Avatar of communityCommunity Picks·2y

    Dependency injection in React - How to Manage Dependencies in Your React App for Cleaner and Easier to Maintain Code

    Dependency injection (DI) is a design pattern that allows the injection of dependencies like variables, objects, or services into code rather than hard-coding them directly. It is commonly used in backend applications but can also benefit React applications by making them more maintainable and testable. The process involves using React’s `createContext` and `useContext` for managing dependencies, which helps avoid prop drilling. DI in React is especially helpful for handling side effects, API calls, and other business logic outside of components, making the code more modular and easier to test.

  19. 19
    Article
    Avatar of codemazeCode Maze·2y

    How to Test IServiceCollection Registrations in .NET

    Unit testing IServiceCollection registrations in .NET is essential for catching errors related to dependency injection setups early in the development cycle. By testing service configurations—such as Singleton, Scoped, and Transient lifetimes—developers can ensure that dependencies are correctly registered and injected, improving code reliability and maintainability. The process involves creating extension methods for service registration and validating them through unit tests, promoting best coding practices and overall application stability.

  20. 20
    Article
    Avatar of baeldungBaeldung·2y

    Autowiring an Interface With Multiple Implementations

    Learn how to autowire an interface with multiple implementations in Spring Boot using qualifiers, profiles, and other tools provided by Spring.

  21. 21
    Article
    Avatar of codemazeCode Maze·2y

    How to Get an Instance of IServiceProvider in .NET

    In modern .NET applications, understanding how to obtain and use an instance of IServiceProvider is crucial for effective dependency injection, which promotes loose coupling and enhances maintainability. This post outlines various methods to get an instance of IServiceProvider, including during application startup, within service classes, controllers, and unit tests. It also discusses best practices and common pitfalls, emphasizing the importance of proper service lifecycle management and the benefits of constructor injection over direct service resolution.

  22. 22
    Article
    Avatar of habrhabr·2y

    Riverpod in Production

    Riverpod is a versatile state management library for Flutter, known for its declarative programming, simplified UI patterns, and enhanced tooling support. It excels in providing a clean, modular dependency injection system, easing the development and maintenance of scalable Flutter applications. The post showcases a production-ready example, outlining key features and providing a structured approach to using Riverpod for dependency injection. Key benefits include modularity, encapsulation, and scalability. The provided project structure and practical guidance help streamline app development.

  23. 23
    Article
    Avatar of mwaseemzakirWaseem .NET Newsletter·2y

    EP 64 : Service Locator Pattern in .NET

    The service locator pattern in .NET allows for the injection and retrieval of services via a central service provider. It's useful in scenarios where dependency injection isn't feasible, such as dealing with service scope mismatches or updating legacy code. Although practical, it has drawbacks, including testing complications and potential for poor design choices. Direct dependency injection is generally preferred for its cleaner and more manageable structure.

  24. 24
    Article
    Avatar of codemazeCode Maze·2y

    Dynamically Change the ServiceLifetime of a Registered Service in .NET

    Managing dependencies effectively is crucial in modern application development. This guide covers how to change the ServiceLifetime of registered services in .NET, which is especially useful for optimizing performance in various environments like development, staging, or production. The post provides reusable extension methods to replace service registrations with different lifetimes, such as Singleton, Scoped, or Transient. Practical examples demonstrate how to implement these methods, ensuring flexibility and control over application dependencies.

  25. 25
    Article
    Avatar of awegoAwesome Go·2y

    What even is “Dependency Injection”? (a practical example using Go)

    Dependency injection allows for substituting implementations of a thing with another implementation. It decouples the service from the dependencies, making it easier to test and switch implementations in the future.