Zentient.Abstractions
3.0.2
dotnet add package Zentient.Abstractions --version 3.0.2
NuGet\Install-Package Zentient.Abstractions -Version 3.0.2
<PackageReference Include="Zentient.Abstractions" Version="3.0.2" />
<PackageVersion Include="Zentient.Abstractions" Version="3.0.2" />
<PackageReference Include="Zentient.Abstractions" />
paket add Zentient.Abstractions --version 3.0.2
#r "nuget: Zentient.Abstractions, 3.0.2"
#:package Zentient.Abstractions@3.0.2
#addin nuget:?package=Zentient.Abstractions&version=3.0.2
#tool nuget:?package=Zentient.Abstractions&version=3.0.2
Zentient.Abstractions
⚠️ CRITICAL - 3.0.0 BREAKING CHANGES
This is a complete rewrite with massive breaking changes from 2.x versions.
📚 REQUIRED READING: Migration Guide before upgrading.
New Projects: Continue reading below for the modern 3.0 architecture.
Zentient.Abstractions 3.0 is the foundational library for the Zentient Framework, providing comprehensive abstractions that enable the four-pillar architecture for building robust, extensible, and protocol-agnostic applications. This major release introduces a unified framework core with enhanced developer experience and enterprise-grade capabilities.
🏗️ Four-Pillar Architecture
Zentient Framework 3.0 is built upon four interconnected pillars that ensure consistency, discoverability, and robust error handling:
1. 🧩 Definition-Centric Core (The "What")
Everything in the framework is self-describing through the ITypeDefinition
interface and composed IHas...
contracts. This metadata layer enables runtime discovery, categorization, and component wiring.
2. ✉️ Universal Envelope (The "How")
All operations return standardized IEnvelope<TCode, TError>
results, providing consistent success/failure communication with rich error information, codes, and metadata.
3. 🏗️ Fluent DI & Application Builder (The "Wiring")
The powerful IContainerBuilder
serves as the composition root, offering fluent APIs for dependency injection, module management, assembly scanning, and application validation.
4. 🩺 Built-in Observability (The "Health")
First-class diagnostic and validation systems through IDiagnosticCheck
and IValidator
interfaces, with results flowing through the universal envelope pattern.
🚀 Getting Started
Install Zentient.Abstractions 3.0 into your .NET project:
dotnet add package Zentient.Abstractions
Supported Frameworks: .NET 6.0, .NET 7.0, .NET 8.0, and .NET 9.0
Quick Start Example
using Zentient.Abstractions;
using Zentient.Abstractions.Builders;
// Build the complete Zentient application core
var zentient = await new ContainerBuilder()
.RegisterFromAssemblies(Assembly.GetExecutingAssembly())
.AddModule<MyApplicationModule>()
.ConfigureValidationOnRegistration(true)
.BuildZentientAsync();
// Access all framework systems through unified interface
var orderService = zentient.Services.Resolve<IOrderService>();
var validator = zentient.Validators.GetValidator<CreateOrderRequest,
OrderValidationCodeDefinition,
OrderValidationErrorDefinition>();
var diagnostics = zentient.GetDiagnosticRunner<
SystemHealthCodeDefinition,
SystemHealthErrorDefinition>();
✨ Key Features & Interfaces
Core Framework Interface
IZentient
: Unified entry point providing access to all framework systemsIContainerBuilder
: Comprehensive DI container with advanced features- Enhanced DX: Global using directives and convenience namespaces
Definition-Centric Types
ITypeDefinition
: Rich metadata for all framework componentsIIdentifiable
: Unique identification systemIHas...
Interfaces: Composable capability contracts (Name, Version, Description, etc.)
Universal Envelopes
IEnvelope<TCodeDefinition, TErrorDefinition>
: Standardized operation resultsIHeaderedEnvelope
: Protocol-agnostic header supportIStreamableEnvelope
: Support for streaming scenarios
Observability & Validation
IValidator<TIn, TCodeDefinition, TErrorDefinition>
: Type-safe validationIDiagnosticCheck<TSubject, TCodeDefinition, TErrorDefinition>
: Health monitoringIDiagnosticRunner
: Coordinated diagnostic execution
Configuration & Options
IConfiguration
: Flexible configuration managementITypedConfiguration<TOptionsDefinition, TValue>
: Strongly-typed optionsIConfigurationBinder
: Dynamic configuration binding
Supporting Types
ICode<TCodeDefinition>
: Structured, protocol-agnostic codesIErrorInfo<TErrorDefinition>
: Rich error informationIContext<TContextDefinition>
: Hierarchical execution contextIMetadata
: Extensible key-value metadata system
🎯 Developer Experience Enhancements
Simplified Namespace Usage
// Single import for most scenarios
using Zentient.Abstractions;
// Specialized imports only when needed
using Zentient.Abstractions.Builders; // For advanced building
using Zentient.Abstractions.Health; // For health & validation
Enhanced Debugging
- Source Link Integration: Step-through debugging into framework source
- Rich Documentation: Comprehensive IntelliSense support
- Symbol Packages: Enhanced debugging experience
Enterprise Features
- Assembly Scanning: Automatic service discovery
- Module System: Organized service registration
- Conditional Registration: Environment-aware configuration
- Advanced Patterns: Decorators, interceptors, and policies
🏛️ Architectural Benefits
Protocol Agnostic
Design core logic independently of transport protocols (HTTP, gRPC, Messaging)
Type Safety
Strongly-typed definitions and generic constraints ensure compile-time correctness
Testability
Decoupled interfaces and unified result patterns promote comprehensive testing
Consistency
Universal envelope pattern and definition-centric design ensure predictable behavior
Extensibility
Composable interfaces and metadata system support diverse application requirements
📊 What's New in 3.0.0
Major Architectural Improvements
- ✨ IZentient Interface: Unified framework entry point
- 🏗️ Enhanced Container Builder: Advanced DI capabilities with validation
- 🎯 Four-Pillar Architecture: Complete framework foundation
- 📦 Improved Package Metadata: Enhanced discoverability and debugging
Developer Experience Enhancements
- 🚀 Global Using Directives: Reduced namespace imports
- 📝 Rich Documentation: Comprehensive XML documentation
- 🔗 Source Link Support: Enhanced debugging experience
- 🎨 Convenience Namespaces: Streamlined access patterns
Breaking Changes
- Moved from 2.x envelope patterns to comprehensive 3.0 architecture
- Enhanced type definitions with richer metadata support
- Unified service resolution through IZentient interface
See CHANGELOG.md for complete details.
💡 Example Use Cases
Building Applications
var app = await new ContainerBuilder()
.RegisterFromCallingAssembly()
.AddModule<CoreModule>()
.AddModule<DataModule>()
.ConfigureValidationOnRegistration(true)
.BuildZentientAsync();
Validation
var validator = zentient.Validators.GetValidator<CustomerDto,
CustomerValidationCodeDefinition,
CustomerValidationErrorDefinition>();
var result = await validator.Validate(customerData);
if (!result.IsSuccess)
{
foreach (var error in result.Errors)
Console.WriteLine($"Validation error: {error.Message}");
}
Health Monitoring
var diagnostics = zentient.GetDiagnosticRunner<
ServiceHealthCodeDefinition,
ServiceHealthErrorDefinition>();
var healthReport = await zentient.PerformHealthCheckAsync<
SystemHealthCodeDefinition,
SystemHealthErrorDefinition>();
```csharp
public interface IEndpointCode
{
string Name { get; }
int? Numeric { get; }
string? Protocol { get; }
}
```
IMetadata
: A flexible interface for attaching structured contextual metadata as key-value pairs to various entities (e.g.,IContext
,IEnvelope
). It supports type-safe retrieval of tags.public interface IMetadata { IReadOnlyCollection<string> Keys { get; } IReadOnlyCollection<object> Values { get; } bool TryGetTag<TValue>(string key, out TValue? value); IMetadata WithTag<TValue>(string key, TValue value); }
IPolicy<T>
: Defines a contract for applying cross-cutting concerns or retry logic to operations that produce a result of typeT
.public interface IPolicy<T> { Task<T> Execute(Func<CancellationToken, Task<T>> operation, CancellationToken cancellationToken = default); }
IFormatter<TIn, TOut>
: A generic interface for transforming one type of value into another, useful for data serialization, deserialization, or mapping.public interface IFormatter<in TIn, TOut> { Task<TOut> Format(TIn input, CancellationToken cancellationToken = default); }
Unit
: A lightweight, singleton value type used to represent the absence of a specific value in generic contexts, similar tovoid
in C# ornull
but as a concrete, serializable type. It's particularly useful in functional programming patterns where a generic type parameter is required but no meaningful data needs to be conveyed.public readonly struct Unit : IEquatable<Unit>, IComparable, IComparable<Unit> { public static Unit Value { get; } // Singleton instance // ... operators and methods for equality, comparison, serialization }
💡 Why Use Zentient.Abstractions?
- Protocol Agnostic: Design your core logic independently of specific transport protocols (HTTP, gRPC, Messaging).
- Structured Outcomes: Standardize how operations report success, failure, and associated information, moving beyond exceptions for expected business flows. This is fundamental to how libraries like Zentient.Results operate.
- Extensibility: Provides interfaces that can be easily implemented and extended to fit diverse application requirements.
- Testability: Decoupled interfaces promote easier unit testing of business logic.
- Consistency: Enforces a consistent approach to common application concerns across your codebase, serving as the common language for all Zentient Framework components.
🤝 Contributing
We welcome contributions! Please visit our GitHub Repository for the latest source code, issues, and contribution guidelines.
📄 License
Zentient.Abstractions is licensed under the MIT License. See the LICENSE file for details.
Zentient Framework 3.0 - Building the future of .NET applications with consistency, discoverability, and exceptional developer experience.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. 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 is compatible. 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 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 is compatible. 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. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- No dependencies.
-
net6.0
- No dependencies.
-
net7.0
- No dependencies.
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages (3)
Showing the top 3 NuGet packages that depend on Zentient.Abstractions:
Package | Downloads |
---|---|
Zentient.Metadata.Attributes
Attribute-based metadata for Zentient Framework. Implements the Zentient.Metadata Attribute Specification, supporting legacy and cross-package attributes. See README.md, CHANGELOG.md, and docs/Zentient_Metadata_Metadata-Attribute-Specification.md for details. |
|
Zentient.Metadata
Core metadata engine for Zentient Framework. See README.md and CHANGELOG.md for details. |
|
Zentient.Metadata.Abstractions
Forward-compatible metadata abstractions for Zentient Framework. Provides interfaces and contracts for metadata, builders, scanners, tags, and preset keys. See README.md and CHANGELOG.md for details. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Zentient Framework 3.0.1 - Patch release: DocFX deployment fixes, .NET 9.0 badge restoration, workflow optimizations, NUGET_API_KEY validation, and documentation improvements since 3.0.0.