Design: Proxy Pattern Implementation
Design and implement the proxy pattern for a generic service object. Out of scope are specific business logic of the real object and network communication details.
Functional Requirements
FR1: Provide a surrogate or placeholder for another object to control access to it
FR2: Support lazy initialization to delay object creation until needed
FR3: Allow access control to restrict or log requests to the real object
FR4: Enable caching of expensive operations to improve performance
FR5: Maintain the same interface as the real object for seamless substitution
Non-Functional Requirements
NFR1: The proxy should not change the interface of the real object
NFR2: Must handle concurrent access safely if used in multithreaded environments
NFR3: Should add minimal overhead to method calls
NFR4: Support scalability for multiple proxy instances
NFR5: Latency for proxy operations should be under 50ms for typical calls