Cocoar.Capabilities
1.2.1
dotnet add package Cocoar.Capabilities --version 1.2.1
NuGet\Install-Package Cocoar.Capabilities -Version 1.2.1
<PackageReference Include="Cocoar.Capabilities" Version="1.2.1" />
<PackageVersion Include="Cocoar.Capabilities" Version="1.2.1" />
<PackageReference Include="Cocoar.Capabilities" />
paket add Cocoar.Capabilities --version 1.2.1
#r "nuget: Cocoar.Capabilities, 1.2.1"
#:package Cocoar.Capabilities@1.2.1
#addin nuget:?package=Cocoar.Capabilities&version=1.2.1
#tool nuget:?package=Cocoar.Capabilities&version=1.2.1
High-performance capability composition for .NET
A high-performance, low-allocation capability composition library for .NET that implements the Capability Composition pattern for building extensible, type-safe systems.
Installation
dotnet add package Cocoar.Capabilities
Quick Start
using Cocoar.Capabilities;
// Create a scope and compose capabilities onto a subject
var scope = new CapabilityScope();
scope.Compose("user-service")
.Add(new LoggingCapability { Level = LogLevel.Debug })
.Add(new RetryCapability { MaxAttempts = 3 })
.Build();
// Query the composition
var composition = scope.Compositions.GetRequired<string>("user-service");
var logging = composition.GetFirstOrDefault<LoggingCapability>();
Console.WriteLine(composition.Has<LoggingCapability>()); // True
Documentation
Full documentation with guides, API reference, and examples:
- Getting Started — Install, compose, query
- Why Capabilities? — The problem this solves
- API Reference — Complete method reference
- Examples — Real-world patterns
Key Concepts
| Type | Role |
|---|---|
CapabilityScope |
Container that manages composers and compositions |
Composer |
Fluent builder for attaching capabilities to a subject |
IComposition |
Immutable, thread-safe result of a composition |
IPrimaryCapability |
Marker interface for the "identity" capability |
CapabilityScope<TOwner> |
Strongly-typed scope with immutable owner |
Contributing & Versioning
- SemVer (additive MINOR, breaking MAJOR)
- PRs & issues welcome
- Licensed under Apache License 2.0 (explicit patent grant & attribution via NOTICE)
License & Trademark
This project is licensed under the Apache License, Version 2.0. See NOTICE for attribution.
"Cocoar" and related marks are trademarks of COCOAR e.U. Use of the name in forks or derivatives should preserve attribution and avoid implying official endorsement. See TRADEMARKS for permitted and restricted uses.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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. |
-
net8.0
- No dependencies.
NuGet packages (3)
Showing the top 3 NuGet packages that depend on Cocoar.Capabilities:
| Package | Downloads |
|---|---|
|
Cocoar.Configuration
Reactive, strongly-typed configuration for .NET. Layered rules, atomic updates, feature flags, entitlements, memory-safe secrets (RSA-OAEP + AES-256-GCM), health monitoring, and providers (file, environment, command-line, static, observable). |
|
|
Cocoar.Configuration.DI
Dependency injection integration for Cocoar.Configuration. Configuration type registration, lifetime customization, keyed services, and context resolver registration for feature flags and entitlements. |
|
|
Cocoar.Configuration.Flags
Feature Flags and Entitlements for Cocoar.Configuration. Provides delegate-based flags with metadata via Capabilities. Base classes for temporary feature flags (with expiration) and permanent entitlements. Reactive, type-safe, and designed for clean separation of technical vs business decisions. Includes a Roslyn source generator that emits descriptor-based registry population at compile time. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Full release notes: https://github.com/cocoar-dev/Cocoar.Capabilities/blob/develop/CHANGELOG.md