DevelApp.RuntimePluggableClassFactory 1.0.7

dotnet add package DevelApp.RuntimePluggableClassFactory --version 1.0.7                
NuGet\Install-Package DevelApp.RuntimePluggableClassFactory -Version 1.0.7                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DevelApp.RuntimePluggableClassFactory" Version="1.0.7" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DevelApp.RuntimePluggableClassFactory --version 1.0.7                
#r "nuget: DevelApp.RuntimePluggableClassFactory, 1.0.7"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install DevelApp.RuntimePluggableClassFactory as a Cake Addin
#addin nuget:?package=DevelApp.RuntimePluggableClassFactory&version=1.0.7

// Install DevelApp.RuntimePluggableClassFactory as a Cake Tool
#tool nuget:?package=DevelApp.RuntimePluggableClassFactory&version=1.0.7                

RuntimePluggableClassFactory

This library has been made to make dependency injection at runtime. The main idea is to use a plugin folder from where the factory can load dll's. Factory that loads classes from provided assemblies having a specific user implemented interface inheriting from the provided IPluginClass interface.

Why use it and where

  • Websites/APIs that are running without persisted session state behind a login
    • As Asp.Net is implemented with compiled code the website will reload when a new dependency injection needs to be reloaded causing all session state information to disappear and typically logged in users will be expelled
  • Separating much modified extensions from the running code when making a program execution framework so that
    • application can internally contain the Continouos Deployment approval
    • extensions can be loaded and replaced at runtime
    • making it possible to make a/b testing for services
    • extension loading errors are not taking down the whole application and only the affected extension
    • making it easier to test extensions separated from other concerns

Design

  • You call a class factory (PluginClassFactory) to get a specific instance of a class

State

  • I have used it for a couple of projects which run in production

TODO

  • Include documentation on how to use the library as it is only existing in code right now
  • Massively extend the unit and integration testing
  • Assembly loader based on Nuget
    • Automatic updates support
    • Triggered updates support
    • Use Semantic versioning so that 1.2.x will return the latest as it is only corrections without breaking changes
    • Investigate if Semantic versioning only makes sense for interfaces and not for implementations
  • Unload ApplicationLoadContext when not any longer in use
  • Perhaps use the (Dot Net Tools)[https://github.com/RicoSuter/DNT] to switch between project and nuget references if I can get it to work in GitHub Actions
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp3.1 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on DevelApp.RuntimePluggableClassFactory:

Package Downloads
DevelApp.Workflow.AutoFac

Setup for AutoFac for DevelApp.Workflow DevelApp.Workflow which is an oppinionated Workflow for Akka.Net making it easy to handle workflows

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.7 765 11/21/2021
1.0.6 388 12/23/2020
1.0.4 457 12/22/2020
1.0.3 398 11/17/2020
1.0.2 762 11/8/2020
1.0.1 412 11/8/2020
1.0.0 447 11/8/2020