$ show reactiveui/splat
Splat is a cross-platform .NET utility library that provides a lean abstraction layer for dependency injection (service location), logging, bitmap loading, color handling, and application performance monitoring. It is part of the ReactiveUI ecosystem and is designed to work across .NET Framework, .NET Core, Xamarin, and modern .NET (including NativeAOT). The library offers multiple DI container adapters (Autofac, DryIoc, Ninject, SimpleInjector, Microsoft.Extensions.DependencyInjection), logging backends (Serilog, NLog, Log4Net, Microsoft.Extensions.Logging, Exceptionless), and bitmap loaders (SkiaSharp, WPF, Android native, Cocoa). The core service location includes several resolver implementations with different performance characteristics, including a modern lock-free generic-first resolver optimized for AOT. The logging abstraction supports allocation-free typed arguments and composable wrappers. While the library is well-tested and actively maintained, some adapter packages are marked as alpha/prototype and a few components rely on reflection or platform-specific code that may drift.
The LLM identified 4 files worth highlighting for reuse:
A generic, thread-safe MRU (Most Recently Used) cache with invalidation, disposal callbacks, and configurable equality comparer. It uses a linked list and dictionary internally and is used by the logging subsystem to cache loggers. The implementation is self-contained and could be extracted for any caching scenario that needs bounded memory with eviction.
An AOT-friendly, lock-free dependency resolver that uses static generic types for registration containers, enabling O(1) resolution without locking. It supports contracts, lazy singletons, and callbacks. The pattern of using generic types for per-type storage is reusable for other high-performance service location implementations.
A composable logger decorator that wraps any ILogger and provides the full IFullLogger interface with structured logging, exception handling, and format provider support. It follows the Decorator pattern and can be nested with other wrappers (e.g., WrappingPrefixLogger). The design demonstrates clean separation of logging concerns and is reusable as a template for adapter patterns.
A static utility that calculates optimal decode sizes for bitmaps given target dimensions, with support for subsampling and orientation-aware fitting. It is used across all platform bitmap loaders (SkiaSharp, WPF, Android, Cocoa) and demonstrates a well-encapsulated cross-platform algorithm for image decoding size computation.