|
|
|
|
|
by ThunderSizzle
83 days ago
|
|
C# isnt a duck type language (well, you can do that via dynamic keyword, but I don't know who would do that typically). Most integration libraries in Nuget (aka c#'s cargo) are AB type libraries. E.g.
DI Container: Autofac
Messaging Library: MediatR
Integration: MediatR.Extensions.Autofac.DependencyInjection There are many examples of popular libraries like this in that world. |
|
Dependency injection is a popular solution for this problem, and you can do that as well in Rust. It requires (again) that the API is designed for dependency injection, and instead of interfaces and is-a relationships, you now have "factories" producing the implementation.