#dependencyinjection — Public Fediverse posts
Live and recent posts from across the Fediverse tagged #dependencyinjection, aggregated by home.social.
-
🔗 Laravel Route Binding Behind the Curtains
https://wendelladriel.com/blog/laravel-route-binding-behind-the-curtains
#laravel #dependencyinjection #routing #deepdive #models -
🚀 Koin 4.2.1 is out!
Fixes include:
✔️ Linked scope param resolution
✔️ JVM ABI compatibility restored
✔️ Scope concurrency fixPlus better error messages & safer CI checks 👏
👇
https://github.com/InsertKoinIO/koin/releases/tag/4.2.1#Kotlin #AndroidDev #Koin #KMP #Android #DependencyInjection
-
🚀 Koin 4.2.1-RC1 is out!
🐛 Fixes ABI issue in runOnKoinStarted
🔍 Better scope error messages
⚙️ CI now enforces API compatibility🔜 Concurrency + env fixes coming in final
👉 https://github.com/InsertKoinIO/koin/releases/tag/4.2.1-RC1
-
No More Public References - Final Dependency #Dependencyinjection #Editortools #Optimisation #Tools #Publicvariables #Scripting #Automation #AssetStore
https://u3dn.com/packages/no-more-public-references-final-dependency-293239
-
Meet #Rust + #DependencyInjection #MacroCrimes:
Supercharge Rust functions with implicit arguments using CGP v0.7.0
https://contextgeneric.dev/blog/v0.7.0-release/
Absolutely mind-blowing stuff! 🤯
I think this can be very useful for e.g. #UI libraries - really reminds me of #Vue's provide/inject mechanism:
https://vuejs.org/guide/components/provide-inject.html#provide-inject
-
Meet #Rust + #DependencyInjection #MacroCrimes:
Supercharge Rust functions with implicit arguments using CGP v0.7.0
https://contextgeneric.dev/blog/v0.7.0-release/
Absolutely mind-blowing stuff! 🤯
I think this can be very useful for e.g. #UI libraries - really reminds me of #Vue's provide/inject mechanism:
https://vuejs.org/guide/components/provide-inject.html#provide-inject
-
Meet #Rust + #DependencyInjection #MacroCrimes:
Supercharge Rust functions with implicit arguments using CGP v0.7.0
https://contextgeneric.dev/blog/v0.7.0-release/
Absolutely mind-blowing stuff! 🤯
I think this can be very useful for e.g. #UI libraries - really reminds me of #Vue's provide/inject mechanism:
https://vuejs.org/guide/components/provide-inject.html#provide-inject
-
Meet #Rust + #DependencyInjection #MacroCrimes:
Supercharge Rust functions with implicit arguments using CGP v0.7.0
https://contextgeneric.dev/blog/v0.7.0-release/
Absolutely mind-blowing stuff! 🤯
I think this can be very useful for e.g. #UI libraries - really reminds me of #Vue's provide/inject mechanism:
https://vuejs.org/guide/components/provide-inject.html#provide-inject
-
Meet #Rust + #DependencyInjection #MacroCrimes:
Supercharge Rust functions with implicit arguments using CGP v0.7.0
https://contextgeneric.dev/blog/v0.7.0-release/
Absolutely mind-blowing stuff! 🤯
I think this can be very useful for e.g. #UI libraries - really reminds me of #Vue's provide/inject mechanism:
https://vuejs.org/guide/components/provide-inject.html#provide-inject
-
🧵 New: Modernizing .NET – Part 12
Use HttpClientFactory in legacy background threads with the SharedContext pattern.
Thread‑safe, DI‑friendly, minimal refactoring.📖 Read → https://medium.com/@michael.kopt/19c66938fedf
#DotNet #DotNetCore #DotNet8 #DotNet9 #DotNet10 #ASPNet #ASPNetCore #CSharp #LegacyCode #HttpClientFactory #DependencyInjection #BackgroundThreads -
🧵 New: Modernizing .NET – Part 12
Use HttpClientFactory in legacy background threads with the SharedContext pattern.
Thread‑safe, DI‑friendly, minimal refactoring.📖 Read → https://medium.com/@michael.kopt/19c66938fedf
#DotNet #DotNetCore #DotNet8 #DotNet9 #DotNet10 #ASPNet #ASPNetCore #CSharp #LegacyCode #HttpClientFactory #DependencyInjection #BackgroundThreads -
🧵 New: Modernizing .NET – Part 12
Use HttpClientFactory in legacy background threads with the SharedContext pattern.
Thread‑safe, DI‑friendly, minimal refactoring.📖 Read → https://medium.com/@michael.kopt/19c66938fedf
#DotNet #DotNetCore #DotNet8 #DotNet9 #DotNet10 #ASPNet #ASPNetCore #CSharp #LegacyCode #HttpClientFactory #DependencyInjection #BackgroundThreads -
Une lib d'injection de dépendance en JavaScript.
-
Dependency Injection is a very practical technique for writing testable code and swappable implementation.
https://dev.to/hongster85/dependency-injection-understand-in-3-minutes-3a5k
#bestpractices #coding #codingprinciples #designpattern #programming #dependencyinjection
-
Dependency Injection is a very practical technique for writing testable code and swappable implementation.
https://dev.to/hongster85/dependency-injection-understand-in-3-minutes-3a5k
#bestpractices #coding #codingprinciples #designpattern #programming #dependencyinjection
-
Dependency Injection is a very practical technique for writing testable code and swappable implementation.
https://dev.to/hongster85/dependency-injection-understand-in-3-minutes-3a5k
#bestpractices #coding #codingprinciples #designpattern #programming #dependencyinjection
-
Dependency Injection is a very practical technique for writing testable code and swappable implementation.
https://dev.to/hongster85/dependency-injection-understand-in-3-minutes-3a5k
#bestpractices #coding #codingprinciples #designpattern #programming #dependencyinjection
-
Dependency Injection is a very practical technique for writing testable code and swappable implementation.
https://dev.to/hongster85/dependency-injection-understand-in-3-minutes-3a5k
#bestpractices #coding #codingprinciples #designpattern #programming #dependencyinjection
-
After several hours of concentrated work, a lot of repetitive copy/paste and search/replace as well as a bit of semi-successful utilization of AI agents, I migrated our Android application from dependency injection via Hilt to Metro (by @ZacSweers). 580 files were touched in this process 😅
I already appreciate the concise syntax and Anvil-esque aggregation ❤️
#Android #AndroidDev #Hilt #Dagger #Metro #Anvil #DependencyInjection
-
via @dotnet : Implementing Cross-Platform In-App Billing in .NET MAUI Applications
https://ift.tt/T4RY19z
#DotNetMAUI #InAppBilling #CrossPlatform #MobileDevelopment #GooglePlayBilling #StoreKit #MicrosoftStore #DependencyInjection #MVVM #AppDevelopment #Softwar… -
Neu im Forum:
Neue dependency-injection 7.4 kann Systeme brechen
https://t3forum.net/d/1047-neue-dependency-injection-74-kann-systeme-brechen
-
🚀 Koin 4.2.0-alpha3 is out!
✅ Navigation 2.x scope support
🧹 Cleaner, better examples
🐛 Fix for Nav3 metadata args🔗 https://github.com/InsertKoinIO/koin/releases/tag/4.2.0-alpha3
#Kotlin #AndroidDev #Compose #Koin #DependencyInjection #Android
#MobileDev -
[com.stuartsierra/component "1.2.0"]
‘Component’ is a #DependencyInjection and lifecycle management framework for #Clojure.
This release makes SystemMaps Closeable, so you can use them in `with-open`.
Having dredged up the steps to deploy on Clojars and, miraculously, still having all the right credentials, I made a new release, the first in over 2 years!
https://github.com/stuartsierra/component
https://clojars.org/com.stuartsierra/component/versions/1.2.0
https://github.com/stuartsierra/component/blob/master/CHANGES.md -
via @dotnet : Upgrading to Microsoft Agent Framework in Your .NET AI Chat App
https://ift.tt/JARZoFE
#MicrosoftAgentFramework #DotNet #AIChatApp #AIIntegration #Chatbot #CSharp #VisualStudio #AzureOpenAI #DependencyInjection #Middleware #SemanticSearch #Software… -
Is your Koin configuration slowing down your Kotlin/Android app? 🐌
My new interview with @kotzilla is LIVE!
We dive into their AI Performance Monitoring platform that catches issues & automatically generates contextual fix prompts for Gemini/Copilot. ✨
The future of DI is self-healing! 🩺
#Kotlin #AndroidDev #Koin #AIPerformance #DependencyInjection
-
Is your Koin configuration slowing down your Kotlin/Android app? 🐌
My new interview with @kotzilla is LIVE!
We dive into their AI Performance Monitoring platform that catches issues & automatically generates contextual fix prompts for Gemini/Copilot. ✨
The future of DI is self-healing! 🩺
#Kotlin #AndroidDev #Koin #AIPerformance #DependencyInjection
-
Is your Koin configuration slowing down your Kotlin/Android app? 🐌
My new interview with @kotzilla is LIVE!
We dive into their AI Performance Monitoring platform that catches issues & automatically generates contextual fix prompts for Gemini/Copilot. ✨
The future of DI is self-healing! 🩺
#Kotlin #AndroidDev #Koin #AIPerformance #DependencyInjection
-
Trying to learn Dependency Injection (Hilt)
Everything is spiraling out of control.
Nothing makes sense.
Nothing lines up with my App structure.
Seems like an awful lot of work for very little return.
Everything is sliding off my tiny brain. -
Learn essential object oriented programming patterns in PHP including creational structural behavioral and concurrency patterns for efficient coding
https://colisty.netlify.app/courses/php_objects_object_oriented_programming_software_patterns_on_demand/
#php #objectorientedprogramming #softwarepatterns #creationalpatterns #structuralpatterns #behavioralpatterns #concurrencypatterns #dependencyinjection -
Learn essential object oriented programming patterns in PHP including creational structural behavioral and concurrency patterns for efficient coding
https://colisty.netlify.app/courses/php_objects_object_oriented_programming_software_patterns_on_demand/
#php #objectorientedprogramming #softwarepatterns #creationalpatterns #structuralpatterns #behavioralpatterns #concurrencypatterns #dependencyinjection -
Learn essential object oriented programming patterns in PHP including creational structural behavioral and concurrency patterns for efficient coding
https://colisty.netlify.app/courses/php_objects_object_oriented_programming_software_patterns_on_demand/
#php #objectorientedprogramming #softwarepatterns #creationalpatterns #structuralpatterns #behavioralpatterns #concurrencypatterns #dependencyinjection -
Learn essential object oriented programming patterns in PHP including creational structural behavioral and concurrency patterns for efficient coding
https://colisty.netlify.app/courses/php_objects_object_oriented_programming_software_patterns_on_demand/
#php #objectorientedprogramming #softwarepatterns #creationalpatterns #structuralpatterns #behavioralpatterns #concurrencypatterns #dependencyinjection -
🚨 Breaking: Google Guice has made the switch to jakarta.inject‼
Time to revisit my post about the javax→jakarta mess
https://blog.ltgt.net/javax-jakarta-mess-even-worse/ -
Are you sure you're getting Dependency Injection right in SwiftUI?
A thought-provoking analysis of common mistakes in DI within SwiftUI, exploring three key patterns for managing dependencies.
🔗: https://azamsharp.com/2025/09/08/why-90-percent-swiftui-apps-gets-dependency-injection-wrong.html by @azamsharp
-
Suffering from the scourge of insomnia? Want to fall asleep to the sounds of a Haskell application being assembled component by component?
If so, you're in luck. In this 1-hour video I give a demo of how to use the "cauldron" library to wire all the components of a Haskell application at the composition root.
-
🎤 Speaker announcement!
Pimcore Community Dev DaysWe're excited to announce that Alexander M. Turek will be joining us at the Pimcore Community Dev Days on 13 November!
In his talk, 'Deep Dive into @symfony’s Dependency Injection Component', Alexander will unpack the magic behind Autowiring, Autoconfiguration, and Service Discovery. You'll get practical insights and deeper understanding of Symfony’s core features.
Whether you're building with Pimcore, Symfony, or any modern PHP stack—this session is for you.
📍 Frankfurt am Main
📅 13 November 2025ℹ️ Find out more 🔗 https://t1p.de/exsej
🎟️ Get your ticket 🔗 https://t1p.de/hlbkj
👔 LinkedIn Event Page 🔗 https://t1p.de/6xssv#Pimcore #Symfony #DependencyInjection #PHP #TechEvent #WebDevelopment #DeveloperCommunity #PCCD25
-
Why would anyone need a whole framework to pass a value into a constructor? 🤔 It's like hiring a team of architects to help you open a door. 🚪 Let’s face it, the real 'dependency injection' here is injecting #common #sense into tech discussions. 😂
http://rednafi.com/go/di_frameworks_bleh/ #dependencyinjection #techhumor #softwaredevelopment #programmingjokes #HackerNews #ngated -
You probably don't need a dependency injection framework
http://rednafi.com/go/di_frameworks_bleh/
#HackerNews #dependencyinjection #frameworks #softwaredevelopment #programming #bestpractices #coding
-
Announcing CommandLineExtensions, a .NET DI Compatible System.CommandLine Facade | by Peter Ritchie.
https://blog.peterritchie.com/posts/announcing-commandlineextensions
-
Microsoft's HTTP resilience package simplifies using Polly with HTTP client
https://www.damirscorner.com/blog/posts/20250328-HttpResilienceWrapperForPolly.html
-
🇫🇮🐍 Welcome to our next meetup on Wednesday 19th March 2025 at Taiste:
Talks:
✒️ @hamatti - Why developers should write blog posts
💉 Sakari Cajanus - Dependency injection in Python (or why Python is not Java)
🦀 Mislav Novakovic - Refactoring to Rust
And the famous HelPy quiz!
https://www.meetup.com/helpy-meetups/events/306522919/
Please also drop us a line if you’d like to give a talk in April or beyond ⭐
#HelPy #Helsinki #Python #meetup #writing #blogging #DependencyInjection #Rust
-
Une lib d'injection de dépendence (pattern IoT pour *Inversion of Control*) TypeScript qui semble assez simple à utiliser.
-
Argh, I'm refactoring some old Rust code to test it better, and https://github.com/rust-lang/rust/issues/100013 is not letting me use generics to invert dependencies in order to inject some test code into an async function.
I thought I was being such a clever clogs. As I swore in the comment on the offending function, Buttmuppets!
This bug with lifetimes and generic associated types is really unpleasant to discover on a Sunday. Butt. Muppets.
#rust #gat #dry #DependencyInjection #test #async #nonblocking
-
One of our most vital in-depth chapters about #DependencyInjection and #PHP architecture has been updated with a lot of effort from 👏 @lolli - we are happy for getting feedback on these changes.
Please see:
https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/PhpArchitecture/Index.html
-
Generic Repository Pattern in C#
Have you ever dreaded writing the same boilerplate repository code repeatedly? You’re not alone; I will share my implementation of the Code First Generic Repository Pattern in C#. I will only include some of the code because it will make the post incredibly long. At the end of the post, I will share a Goal donation to post a Git download link so you can take it for a spin. As a bonus, the repository uses Code First and Unit of Work.
Generic Repository Pattern in C#
Let’s begin with the Entity interface. The IEntity interface is a typical pattern used in software development to define a contract for entities, typically in the context of data access and persistence. It usually includes a property for the entity’s unique identifier. The Generic Type: The IEntity interface uses a generic type parameter TKey to allow flexibility in the type of the identifier (e.g., int, Guid, string). The ID property will identify each entity uniquely. Feel free to read more about the implementation at the entity framework core generic repository and Structured Query IEntity.
public interface IEntity<TKey>{ TKey Id { get; set; }}You might find the following definition of the generic repository pattern on the interwebs.
The Generic Repository pattern in C# is a design pattern that abstracts the application’s data layer, making it easier to manage data access logic across different data sources. It aims to reduce redundancy by implementing typical data operations in a single, generic repository rather than having separate repositories for each entity type.
public interface IGenericRepository<TEntity, TKey> where TEntity : class, IEntity<TKey>{ void Delete(TEntity entityToDelete); TEntity? GetFirstOrDefault(Expression<Func<TEntity, bool>> predicate); void Update(TEntity entityToUpdate); void Save(); void Dispose();}The interface header has two generic types. TEntity is the domain class, and the TKey is the ID type, int, or string. Note that IEntity abstracts away the type TKey. It looks complex for the moment, but you will see benefits later.
Moving away from the Generic Repository, let’s focus on the pattern of the Unit of Work. According to Copilot:
The Unit of Work is a design pattern used in software development to manage and coordinate changes to a database. It ensures that all operations within a single business transaction are treated as a single unit, which means they either all succeed, or all fail together. This helps maintain data integrity and consistency.
public interface IUnitOfWork : IDisposable{ IGenericRepository<TEntity, TKey> Repository<TEntity, TKey>() where TEntity : class, IEntity<TKey>; void Save(); Task<int> SaveAsync();}The Unit of Work will allow us later to inject it as a service for any repository. If you inspect the interface closely, you will notice it has three fields. The most vital of the three is the Repository. The method returns a domain of type repository and key. You can specify the type when using it.
Moving on to the Code First portion, we must tell Entity Framework how to build our database. To do so, we can create a “BloggingContext”.
public class BloggingContext: DbContext{ // Use design time factory public BloggingContext(DbContextOptions<BloggingContext> dbContextOptions) : base(dbContextOptions) { } public DbSet<Blog> Blogs { get; set; } public DbSet<Post> Posts { get; set; }}If you inspect the code closely, you will notice that we inherited from DbContext, which allows us to manipulate the database. The DbContext will also enable us to use DbSets and CRUD methods. You can read more about DbContext Class on the Microsoft website.
Before using your Database Context with Code, you must set up migrations. Migrations allow you to evolve your database as you code and change the schema. I recommend you read up on Migrations managing schemas because it has excellent examples to help you start quickly.
At the high level, in Visual Studio, open up the Tools menu, then the NuGet Package Manager menu, followed by the Console. In the Console, you must install the following package.
Install-Package Microsoft.EntityFrameworkCore.Tools
The Microsoft.EntityFrameworkCore.Tools will allow you to make the following commands.
Add-Migration InitialCreate
Update-Database
Meanwhile, you might want to consider making a DesignTimeDbContextFactory because it aids in setting up the connection string for the database.
public class DesignTimeDbContextFactory : IDesignTimeDbContextFactory<BloggingContext>{ public BloggingContext CreateDbContext(string[] args) { // Build configuration IConfigurationRoot configuration = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) .AddJsonFile("appsettings.Development.json") .Build(); // Get connection string var connectionString = configuration.GetConnectionString("DefaultConnection"); var optionsBuilder = new DbContextOptionsBuilder<BloggingContext>(); optionsBuilder.UseSqlServer(connectionString); return new BloggingContext(optionsBuilder.Options); }}I’m considering publishing the fully working example on Git with the following components.
- Services
- Domain
- Interfaces
- Repository
- Console App with basic CRUD operations
- Dependency Injection
Current Donation Amount
$2.41 – PayPal fees 🤑
Note that the donation amount is being updated manually on my end. I have asked WordPress; see the image for details. I will list your name and last name initials. If you like the website backlink, donate $10 or more, and let me know in the comments your web address.
Donate to Goal of $666 to unlock Code First Generic Repository Pattern 🚀✨
Upon reaching the $666 Goal, I will share the code.
$3.00
Donators List
- Nicholas S 8.20.2024
#CodeEfficiency #CodeFirst #CRUDOperations #CSharp #DatabaseManagement #DbContext #DependencyInjection #DesignPatterns #EntityFramework #GenericRepository #Migrations #RepositoryPattern #SoftwareDevelopment #UnitofWork
-
Have you ever dreaded writing the same boilerplate repository code repeatedly? You’re not alone; I will share my implementation of the Code First Generic Repository Pattern in C#. I will only include some of the code because it will make the post incredibly long. At the end of the post, I will share a Goal donation to post a Git download link so you can take it for a spin. As a bonus, the repository uses Code First and Unit of Work.
Generic Repository Pattern in C#
Let’s begin with the Entity interface. The IEntity interface is a typical pattern used in software development to define a contract for entities, typically in the context of data access and persistence. It usually includes a property for the entity’s unique identifier. The Generic Type: The IEntity interface uses a generic type parameter TKey to allow flexibility in the type of the identifier (e.g., int, Guid, string). The ID property will identify each entity uniquely. Feel free to read more about the implementation at the entity framework core generic repository and Structured Query IEntity.
public interface IEntity<TKey>{ TKey Id { get; set; }}You might find the following definition of the generic repository pattern on the interwebs.
The Generic Repository pattern in C# is a design pattern that abstracts the application’s data layer, making it easier to manage data access logic across different data sources. It aims to reduce redundancy by implementing typical data operations in a single, generic repository rather than having separate repositories for each entity type.
public interface IGenericRepository<TEntity, TKey> where TEntity : class, IEntity<TKey>{ void Delete(TEntity entityToDelete); TEntity? GetFirstOrDefault(Expression<Func<TEntity, bool>> predicate); void Update(TEntity entityToUpdate); void Save(); void Dispose();}The interface header has two generic types. TEntity is the domain class, and the TKey is the ID type, int, or string. Note that IEntity abstracts away the type TKey. It looks complex for the moment, but you will see benefits later.
Moving away from the Generic Repository, let’s focus on the pattern of the Unit of Work. According to Copilot:
The Unit of Work is a design pattern used in software development to manage and coordinate changes to a database. It ensures that all operations within a single business transaction are treated as a single unit, which means they either all succeed, or all fail together. This helps maintain data integrity and consistency.
public interface IUnitOfWork : IDisposable{ IGenericRepository<TEntity, TKey> Repository<TEntity, TKey>() where TEntity : class, IEntity<TKey>; void Save(); Task<int> SaveAsync();}The Unit of Work will allow us later to inject it as a service for any repository. If you inspect the interface closely, you will notice it has three fields. The most vital of the three is the Repository. The method returns a domain of type repository and key. You can specify the type when using it.
Moving on to the Code First portion, we must tell Entity Framework how to build our database. To do so, we can create a “BloggingContext”.
public class BloggingContext: DbContext{ // Use design time factory public BloggingContext(DbContextOptions<BloggingContext> dbContextOptions) : base(dbContextOptions) { } public DbSet<Blog> Blogs { get; set; } public DbSet<Post> Posts { get; set; }}If you inspect the code closely, you will notice that we inherited from DbContext, which allows us to manipulate the database. The DbContext will also enable us to use DbSets and CRUD methods. You can read more about DbContext Class on the Microsoft website.
Before using your Database Context with Code, you must set up migrations. Migrations allow you to evolve your database as you code and change the schema. I recommend you read up on Migrations managing schemas because it has excellent examples to help you start quickly.
At the high level, in Visual Studio, open up the Tools menu, then the NuGet Package Manager menu, followed by the Console. In the Console, you must install the following package.
Install-Package Microsoft.EntityFrameworkCore.Tools
The Microsoft.EntityFrameworkCore.Tools will allow you to make the following commands.
Add-Migration InitialCreate
Update-Database
Meanwhile, you might want to consider making a DesignTimeDbContextFactory because it aids in setting up the connection string for the database.
public class DesignTimeDbContextFactory : IDesignTimeDbContextFactory<BloggingContext>{ public BloggingContext CreateDbContext(string[] args) { // Build configuration IConfigurationRoot configuration = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) .AddJsonFile("appsettings.Development.json") .Build(); // Get connection string var connectionString = configuration.GetConnectionString("DefaultConnection"); var optionsBuilder = new DbContextOptionsBuilder<BloggingContext>(); optionsBuilder.UseSqlServer(connectionString); return new BloggingContext(optionsBuilder.Options); }}I’m considering publishing the fully working example on Git with the following components.
- Services
- Domain
- Interfaces
- Repository
- Console App with basic CRUD operations
- Dependency Injection
Current Donation Amount
$2.41 – PayPal fees 🤑
Note that the donation amount is being updated manually on my end. I have asked WordPress; see the image for details. I will list your name and last name initials. If you like the website backlink, donate $10 or more, and let me know in the comments your web address.
Donate to Goal of $666 to unlock Code First Generic Repository Pattern 🚀✨
Upon reaching the $666 Goal, I will share the code.
$3.00
Donators List
- Nicholas S 8.20.2024
https://vyechi.com/2024/08/20/generic-repository-pattern-in-c/
#CodeEfficiency #CodeFirst #CRUDOperations #CSharp #DatabaseManagement #DbContext #DependencyInjection #DesignPatterns #EntityFramework #GenericRepository #Migrations #RepositoryPattern #SoftwareDevelopment #UnitofWork