awesome-repositories.com
Blog
MCP
awesome-repositories.com

Discover the best open-source repositories with AI-powered search.

ExploreCurated searchesOpen-source alternativesSelf-hosted softwareBlogSitemap
ProjectMCP serverAboutHow we rankPress
LegalPrivacyTerms
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
autofac avatar

autofac/Autofac

0
View on GitHub↗
4,649 stars·846 forks·C#·MIT·19 viewsautofac.org↗

Autofac

Autofac is a dependency injection framework and inversion of control container for .NET. It functions as a component registration engine that decouples class implementations from their dependencies by injecting required services via constructors or properties.

The project includes an assembly scanning library to automatically discover and register components within compiled binaries based on specific type criteria. It provides a service lifetime manager to control object memory duration using singletons, instance-per-dependency, or isolated request scopes.

The framework covers a broad range of capabilities including recursive dependency injection, conditional service resolution, and the organization of registrations into reusable modules. It also supports the management of isolated resolution scopes to ensure instances are properly disposed.

The system integrates with various environments, providing mechanisms for application hosting bootstrapping, serverless function dependency injection, and automated test mocking.

Features

  • Dependency Injection - Decouples application components by automatically supplying required services through constructors or properties.
  • Reflection-Based Dependency Resolution - Uses runtime type inspection to automatically identify and inject required services into constructor parameters.
  • Type-Level Service Maps - Implements a type-safe mapping from service interfaces to their concrete implementations for on-demand retrieval.
  • Assembly Scanning and Discovery - Provides a system to discover and register classes based on specific criteria within compiled assemblies.
  • Assembly Scanning Libraries - Includes a library to automatically discover and register components within compiled .NET assemblies.
  • Assembly Scanning Registrations - Automatically discovers and maps types for injection by searching compiled binaries for specific attributes or interfaces.
  • Automated Component Discovery - Automatically discovers and registers classes within compiled assemblies by scanning for specific attributes or interfaces.
  • Automatic Dependency Resolution - Automatically instantiates requested services and injects all nested dependencies into constructors.
  • Container Module Registrations - Organizes sets of registrations into reusable modules to simplify configuration and implement dynamic logic.
  • Component Registration - Provides a configuration system to map interfaces to concrete implementations using reflection and lambda expressions.
  • Concrete Type Mappings - Provides a method to map concrete classes to services to automatically handle dependency injection.
  • Constructor Injection - Supplies required services to classes via constructors or properties to decouple implementation from consumption.
  • Lambda-Based Instantiation - Allows custom object creation logic through lambda expressions that can access the current resolution context.
  • Dependency Injection Frameworks - Implements a comprehensive framework for inversion of control to manage component dependencies.
  • Factory-Based Instantiation - Defines custom instantiation logic through delegates to resolve dependencies using the component context.
  • .NET IoC Containers - Functions as a centralized .NET container for managing object instantiation and dependency lifetimes.
  • Dependency Tree Traversers - Resolves nested dependencies by repeatedly requesting required types until the entire object graph is instantiated.
  • Container Module Registrations - Encapsulates sets of service mappings into reusable modules to organize configuration and share dependency definitions.
  • Service Lifetime Scopes - Isolates object instances within logical boundaries to control when components are created and automatically disposed.
  • Isolated Resolution Scopes - Provides isolated scopes for resolving services to ensure that scoped instances are properly disposed.
  • Conditional Service Resolution - Allows retrieving services only if they exist, providing a safe way to handle optional registrations.
  • Serverless Job Activators - Implements a system for injecting dependencies into serverless function executions using a dedicated job activator.
  • External Instance Registrations - Allows adding pre-created objects to the container and marking them as externally owned to prevent automatic disposal.
  • Application Bootstrapping - Provides mechanisms to initialize the root module and primary service providers during application startup.
  • Application Hosting Bootstrappers - Provides mechanisms to initialize service providers within application hosting pipelines to manage root and child dependency scopes.
  • Conditional Registrations - Triggers component registration based on whether specific services already exist within the container builder.
  • Generic Type Resolution - Dynamically creates concrete implementations of generic services by mapping open type definitions at runtime.
  • Open Generic Registrations - Provides the ability to map open generic implementations to services, allowing the dynamic creation of closed generic types at runtime.
  • Serverless Injection - Supports injecting dependencies into serverless function executions through a dedicated job activator.
  • Scoped Object Disposals - Ensures instances are properly disposed of when their associated isolated resolution scope ends.
  • Request-Scoped Configurations - Implements memory control by defining object scopes as singletons or per-request instances.
  • Dependency-Mocked Unit Testers - Enables testing classes in isolation by allowing the container to generate mock implementations for dependencies.
  • Web Framework Integrations - Connects dependency injection to web frameworks to manage the lifetimes of controllers and middleware.
  • Dependency Injection - Extensible and popular dependency injection container.

Star history

Star history chart for autofac/autofacStar history chart for autofac/autofac

How this analysis was created: This summary and feature list were written by an AI model that read the project's README and public documentation pages. Each feature links to the documentation it came from; stars, license and language come straight from the GitHub API. The model does not read the source code, and the analysis is refreshed when the project is re-analysed. Learn more on our About page.

AI search

Explore more awesome repositories

Describe what you need in plain English — the AI ranks thousands of curated open-source projects by relevance.

Start searching with AI

Open-source alternatives to Autofac

Similar open-source projects, ranked by how many features they share with Autofac.
  • uber-go/diguber-go avatar

    uber-go/dig

    4,470View on GitHub↗

    dig is a reflection-based dependency injection framework and object graph resolver for Go. It functions as a container that automatically satisfies type dependencies and manages the instantiation of complex networks of objects during application startup. The project utilizes a directed acyclic graph to determine the necessary sequence for object instantiation and employs interface-driven provider mapping to decouple concrete implementations from their satisfied interfaces. It resolves the object hierarchy through reflection-based type resolution and single-pass component wiring to ensure all

    Godependency-injectiondigo
    View on GitHub↗4,470
  • ets-labs/python-dependency-injectorets-labs avatar

    ets-labs/python-dependency-injector

    4,805View on GitHub↗

    This is a dependency injection framework and inversion of control container for Python. It decouples object creation from business logic by managing how services and their dependencies are assembled, delivered, and linked within an application. The framework is distinguished by its ability to perform automated component wiring, using import hooks and decorators to inject dependencies into functions and classes across different modules. It supports non-blocking flows through an asynchronous dependency resolver and manages the initialization and shutdown sequences of shared external resources a

    Pythonaiohttpasynciodependency-injection
    View on GitHub↗4,805
  • jeffijoe/awilixjeffijoe avatar

    jeffijoe/awilix

    4,088View on GitHub↗

    Awilix is a JavaScript dependency injection framework and inversion of control container. It provides a centralized system for registering and resolving services, decoupling application components by automating how dependencies are created and passed to the functions or classes that require them. The framework features an automatic module loader that scans the filesystem using glob patterns to register dependencies based on filenames and exports. It supports parameter-name-based injection and proxy-based resolution to manage how dependencies are delivered to constructors and functions. The s

    TypeScriptawilixdependency-injectionioc
    View on GitHub↗4,088
  • typestack/typeditypestack avatar

    typestack/typedi

    4,242View on GitHub↗

    TypeDI is a TypeScript dependency injection container and inversion of control tool. It functions as a centralized registry and service locator that manages object instantiation and decouples component dependencies using type inference and decorators. The project provides scoped dependency management to isolate service instances within specific contexts, preventing data leakage between different execution flows. It supports flexible service resolution through the use of type-safe tokens and the ability to map unique identifiers or class constructors to specific service instances. The contain

    TypeScriptdependency-injectioninversion-of-controlioc
    View on GitHub↗4,242
See all 30 alternatives to Autofac→

Frequently asked questions

What does autofac/autofac do?

Autofac is a dependency injection framework and inversion of control container for .NET. It functions as a component registration engine that decouples class implementations from their dependencies by injecting required services via constructors or properties.

What are the main features of autofac/autofac?

The main features of autofac/autofac are: Dependency Injection, Reflection-Based Dependency Resolution, Type-Level Service Maps, Assembly Scanning and Discovery, Assembly Scanning Libraries, Assembly Scanning Registrations, Automated Component Discovery, Automatic Dependency Resolution.

What are some open-source alternatives to autofac/autofac?

Open-source alternatives to autofac/autofac include: uber-go/dig — dig is a reflection-based dependency injection framework and object graph resolver for Go. It functions as a container… ets-labs/python-dependency-injector — This is a dependency injection framework and inversion of control container for Python. It decouples object creation… jeffijoe/awilix — Awilix is a JavaScript dependency injection framework and inversion of control container. It provides a centralized… typestack/typedi — TypeDI is a TypeScript dependency injection container and inversion of control tool. It functions as a centralized… khellang/scrutor — Scrutor is a library that extends the standard Microsoft dependency injection container. It provides tools for… swinject/swinject — Swinject is a dependency injection framework for Swift that manages object creation and wiring through a centralized…