AuroraScienceHub.Framework.Composition 10.0.5

Prefix Reserved
dotnet add package AuroraScienceHub.Framework.Composition --version 10.0.5
                    
NuGet\Install-Package AuroraScienceHub.Framework.Composition -Version 10.0.5
                    
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="AuroraScienceHub.Framework.Composition" Version="10.0.5" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AuroraScienceHub.Framework.Composition" Version="10.0.5" />
                    
Directory.Packages.props
<PackageReference Include="AuroraScienceHub.Framework.Composition" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add AuroraScienceHub.Framework.Composition --version 10.0.5
                    
#r "nuget: AuroraScienceHub.Framework.Composition, 10.0.5"
                    
#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.
#:package AuroraScienceHub.Framework.Composition@10.0.5
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=AuroraScienceHub.Framework.Composition&version=10.0.5
                    
Install as a Cake Addin
#tool nuget:?package=AuroraScienceHub.Framework.Composition&version=10.0.5
                    
Install as a Cake Tool

AuroraScienceHub.Framework.Composition

A modular composition framework for .NET applications that provides structured service organization using application modules and service modules.

Overview

Build applications using a modular architecture pattern. Organize dependency injection registration into logical, reusable modules that ensure services are registered only once.

Key Features

  • Modular Architecture - Organize services into logical, reusable modules
  • Single Registration Guarantee - Ensures each module's services are registered only once
  • Assembly Discovery - Automatically tracks assemblies associated with modules
  • Configuration Support - Built-in IConfiguration integration
  • Extension Methods - Helpful utilities for service registration

Installation

dotnet add package AuroraScienceHub.Framework.Composition

Architecture

The composition framework uses a hierarchical structure where Application Modules aggregate multiple Service Modules. Each Service Module encapsulates a cohesive set of service registrations and is guaranteed to be registered only once, preventing duplicate dependencies.

graph TD
    App[Your Application]
    AppModule[ApplicationModule]
    SM1[ServiceModule 1<br/>Database]
    SM2[ServiceModule 2<br/>Caching]
    SM3[ServiceModule 3<br/>Messaging]
    Services[IServiceCollection]

    App -->|Creates & Configures| AppModule
    AppModule -->|Contains| SM1
    AppModule -->|Contains| SM2
    AppModule -->|Contains| SM3

    SM1 -->|Registers Services| Services
    SM2 -->|Registers Services| Services
    SM3 -->|Registers Services| Services

    style App fill:none,stroke:none
    style AppModule fill:none,stroke:none
    style SM1 fill:none,stroke:none
    style SM2 fill:none,stroke:none
    style SM3 fill:none,stroke:none
    style Services fill:none,stroke:none

Key Concepts:

  • ApplicationModule - Top-level module that composes multiple service modules and represents a complete application or subsystem
  • ServiceModule - Self-contained unit that registers a cohesive set of related services (e.g., database, caching, messaging)
  • Single Registration - Each service module maintains internal state to ensure its services are registered exactly once, even if referenced by multiple application modules

Usage

Create a Service Module

public class DatabaseServiceModule : ServiceModuleBase
{
    protected override void ConfigureServicesInternal(
        IServiceCollection services,
        IConfiguration configuration)
    {
        services.AddDbContext<MyDbContext>();
        services.AddScoped<IRepository, Repository>();
    }
}

Create an Application Module

public class MyApplicationModule : ApplicationModuleBase
{
    public MyApplicationModule()
        : base("MyApp", new ServiceModuleBase[]
        {
            new DatabaseServiceModule(),
            new CachingServiceModule()
        })
    {
    }
}

Register in Your Application

var builder = WebApplication.CreateBuilder(args);
var module = new MyApplicationModule();
module.ConfigureServices(builder.Services, builder.Configuration);

Helper Extensions

// Register class with all implemented interfaces
services.AddScopedAsImplementedInterfaces<MyService>();

// Check if service is registered
if (services.ContainsService<IMyService>()) { }

Module Options

public class MyModuleOptions : ApplicationModuleOptionsBase
{
    public string ConnectionString { get; set; }
}

// appsettings.json
{
  "Modules": {
    "MyModule": {
      "ConnectionString": "...",
      "EnableConsumers": true
    }
  }
}

Benefits

  • Maintainability - Clear separation of concerns
  • Reusability - Service modules can be shared across applications
  • Testability - Easy to mock and test individual modules
  • Prevention of Duplicate Registration - Built-in marker pattern

Integration with ASP.NET Core

For web applications, see AuroraScienceHub.Framework.AspNetCore which extends this package with IWebApplicationModule and WebApplicationModuleBase.

License

See LICENSE file in the repository root.

  • AuroraScienceHub.Framework.AspNetCore - ASP.NET Core extensions
  • AuroraScienceHub.Framework.Configuration - Enhanced configuration support
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
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 AuroraScienceHub.Framework.Composition:

Package Downloads
AuroraScienceHub.Framework.AspNetCore

ASP.NET Core extensions for composition, diagnostics, problem details (RFC 7807), security utilities, and routing enhancements.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
10.0.5 102 4/23/2026
10.0.4 116 4/23/2026
10.0.3 128 2/11/2026
10.0.2 118 1/29/2026
10.0.1 241 12/25/2025
10.0.0 448 12/11/2025
9.0.7 453 11/20/2025
9.0.6 203 11/15/2025
9.0.5 159 11/8/2025
9.0.4 172 10/24/2025
9.0.3 230 10/15/2025
9.0.2 215 10/15/2025
9.0.1 224 10/14/2025
9.0.1-workflow-test-2.17 150 10/14/2025