- What is Sphere10 Framework
- Core Design Principles
- Architecture Overview
- Key Capabilities
- Framework Domains
- Related Documentation
Sphere10 Framework is a mature, production-ready .NET 8.0+ comprehensive framework designed for building full-stack applications across desktop, mobile, and web platforms. Originally architected for blockchain systems and P2P applications, Sphere10 Framework has evolved into a general-purpose framework offering robust abstractions, advanced data structures, cryptographic primitives, and enterprise-grade utilities for high-performance .NET development.
Vision: Provide developers with a unified, extensible foundation for building sophisticated applications with minimal boilerplate, maximum code reuse, and built-in support for scalability, security, and cross-platform deployment.
Core Goals:
- Unified Architecture: Consistent patterns across all platforms and application types
- Enterprise Quality: Production-ready, well-tested, thoroughly documented code
- Extensibility: Plugin architecture and extension points throughout all layers
- Performance: Optimized algorithms, memory efficiency, and concurrent execution
- Developer Experience: Intuitive APIs, comprehensive documentation, and clear patterns
- Cross-Platform: Single codebase targeting Windows, macOS, iOS, Android, and .NET 8.0+
Principle: Core framework code has zero dependencies on blockchain or DApp functionality, making it suitable for any .NET project (desktop, web, mobile, server, embedded).
Benefit: Developers can use powerful utilities (cryptography, data structures, networking, serialization) without bringing in specialized blockchain libraries.
Pattern: All utility methods are discoverable through the Tools.* namespace, providing global IntelliSense access to 40+ tool classes.
Example:
byte[] hash = Tools.Crypto.SHA256(data);
string sanitized = Tools.Text.RemoveWhitespace(input);
var connection = Tools.Sqlite.Create(connectionString);
bool running = Tools.WinTool.IsServiceRunning("MyService");The framework follows a 5-layer architectural model:
- System Tier — Core utilities, collections, cryptography, serialization, networking (Sphere10.Framework)
- Processing Tier — Application lifecycle, DI, configuration, business logic (Sphere10.Framework.Application)
- Data Tier — Database abstraction, multi-DB support, ORM integration (Sphere10.Framework.Data.*)
- Presentation Tier — UI components, Windows Forms, Blazor, drawing (Sphere10.Framework.Windows.Forms, Sphere10.Framework.Web.AspNetCore, Sphere10.Framework.Drawing)
- Specialization Tier — Optional specializations (e.g., consensus) (Sphere10.Framework.Consensus)
The framework supports dynamic plugin loading and lifecycle management for extensible applications, particularly useful for blockchain consensus rules and DApp components.
All database access goes through the Sphere10.Framework.Data abstraction layer, providing:
- Multi-database support (SQL Server, SQLite, Firebird, NHibernate)
- Consistent query building API
- Automatic connection pooling
- Transaction management
Sphere10.Framework/
├── Core Utilities (Sphere10.Framework)
├── Application Layer (Sphere10.Framework.Application)
├── Cryptography (Sphere10.Framework.CryptoEx)
├── Communications (Sphere10.Framework.Communications)
├── Data Access (Sphere10.Framework.Data.*)
├── Desktop UI (Sphere10.Framework.Windows.*)
├── Web/Blazor (Sphere10.Framework.Web.AspNetCore)
├── Graphics (Sphere10.Framework.Drawing)
├── Cross-Platform (Sphere10.Framework.iOS/Android/macOS)
└── Consensus (Sphere10.Framework.Consensus)
Sphere10.Framework (Core)
├── HashLib4CSharp (Cryptography)
├── Sphere10.Framework.Communications (Networking)
└── Sphere10.Framework.CryptoEx (Advanced Crypto)
Sphere10.Framework.Data (Database Abstraction)
├── Sphere10.Framework.Data.Sqlite
├── Sphere10.Framework.Data.MSSQL
├── Sphere10.Framework.Data.Firebird
└── Sphere10.Framework.Data.NHibernate
Presentation Layers
├── Sphere10.Framework.Windows.Forms (+ Data variants)
├── Sphere10.Framework.Web.AspNetCore
└── Sphere10.Framework.Drawing
Consensus Framework (Optional Specialization)
└── Sphere10.Framework.Consensus
| Category | Capabilities |
|---|---|
| Collections | B-trees, merkle trees, paged collections, transactional collections, observable collections, 50+ specialized types |
| Cryptography | SHA/Blake2/MD5 (HashLib4CSharp), ECDSA, post-quantum algorithms, key derivation, digital signatures |
| Serialization | Binary, JSON, XML, streaming formats with automatic change tracking |
| Data Access | Multi-database ADO.NET abstraction, SQL query building, CSV support, connection pooling |
| Networking | TCP, UDP, WebSockets, JSON-RPC, anonymous pipes, P2P abstractions |
| UI Components | Windows Forms data binding, Blazor components, cross-platform drawing |
| Caching | LRU/LFU/FIFO strategies, batch caching, session management |
| Utilities | Logging, scheduling, threading, reflection, configuration, environment introspection |
| Testing | NUnit integration, 2000+ comprehensive tests, test utilities |
- Windows: Full .NET Framework + modern .NET support
- Web: ASP.NET Core middleware, Blazor components, WebAssembly hosting
- Mobile: Xamarin.iOS, Xamarin.Android, MAUI integration
- macOS: Xamarin.macOS, native integration
- Runtime: .NET 8.0+ (cross-platform), .NET Framework 4.8+
The core framework provides 40+ domains of specialized functionality:
| Domain | Purpose |
|---|---|
| Collections | Advanced collection types (merkle trees, paged data, transactional, observable) |
| Cryptography | Hashing, signatures, encryption, key derivation, post-quantum |
| Encoding | Hex, Base64, endian conversion |
| Extensions | 200+ extension methods for .NET types |
| IO | Endian-aware file I/O, stream tools, temporary file management |
| Memory | Buffer operations, memory allocation, unit conversion |
| Networking | URL, MIME, POP3, P2P abstractions |
| Objects | Clone, compare, merge, introspection tools |
| Reflection | Type activation, member discovery, attribute inspection |
| Scheduling | Background task scheduling with time-based rules |
| Serialization | Object serialization across multiple formats |
| Streams | Bit streams, blocking streams, bounded streams, pipelines |
| Text | Parsers, inflectors, regex builders, HTML tools |
| Threading | Multi-threading utilities, synchronization primitives |
| XML | Deep serialization, XPath support |
| Domain | Purpose |
|---|---|
| Component Registry | IoC container, dependency injection |
| Configuration | Settings management, environment-aware config |
| Plugin System | Dynamic plugin loading and lifecycle |
| Command-Line | CLI argument parsing and command execution |
| Domain | Purpose |
|---|---|
| Database Abstraction | Multi-database support with unified API |
| Query Building | Fluent SQL query construction |
| Object Spaces | Stream-mapped persistent collections |
| Change Tracking | Automatic dirty tracking and merkle updates |
| Domain | Purpose |
|---|---|
| Windows Forms | Data binding, validation, component library |
| Web/Blazor | ASP.NET Core middleware, Blazor components |
| Drawing | Cross-platform graphics and image manipulation |
All framework components support constructor-based dependency injection via the built-in TinyIoC container. This enables loose coupling and testability.
Consensus rules and other components can be dynamically loaded as plugins, allowing applications to evolve without recompilation.
Advanced data structures use stream-mapping to handle large datasets efficiently without loading everything into memory. Perfect for blockchain applications.
Collections support transactional semantics (begin, commit, rollback) for data consistency in multi-user scenarios.
All utilities are accessible through Tools.* namespace for maximum IntelliSense discoverability. New projects can extend this pattern by adding their own Tool class.
- Framework Domains — Detailed breakdown of all framework domains
- Tools Reference — Complete Tools.* namespace catalog
- 3-Tier Architecture — Architecture pattern documentation
- Code Styling Guidelines — Coding conventions and standards