How ifbars/pcache works
Main components
• Consumer Application (any .NET host that references PCache)
• PCache Library (the .csproj you build and publish)
– PCache (public façade)
– CacheEntry (data structure holding cached object + metadata)
– In‐Memory Store (Dictionary<string, CacheEntry>)
– Persistence Handler (serializes/deserializes CacheEntry collection)
• File System (directory/profile where the cache file is saved/loaded)
• .NET Runtime (CLR hosting PCache code)
Relationships and data flows
– → In‐Memory Store (on Cache and Retrieve calls)
– → Persistence Handler (on Load and on any Save triggers)
• From Persistence Handler → File System (read/write cache file)
Architectural patterns
• Façade Pattern: PCache exposes a simple API hiding the dictionary + file logic
• Repository-style Store: the in‐memory dictionary behaves like a key/value repository
• Persistence Strategy: swap-in a different serializer by extending Persistence Handler
• Single-Responsibility: CacheEntry only holds data + expiry metadata
Technology and framework details
• .NET 6 / C# 10
• System.IO for file I/O
• System.Text.Json or BinaryFormatter (specify your chosen serializer)
• PCache.csproj → targets net6.0, outputs PCache.dll