Late Binding Non-Local Types via Dynamic Proxy
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
In environments where host applications and custom code execute as managed code, dynamic binding across application domains is challenging due to compatibility issues and lack of access to type information, leading to errors when client code tries to bind to server objects without direct access to their type information.
Innovation Solution
A late binding system that allows non-virtual methods of a base class to be effectively overridden by using a dynamic object and transparent proxy, enabling client code to access type information of server objects across application domains through a remote type adapter and dynamic proxy, which provides a virtual invoke method to intercept and override the get type method.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If static binding is used at compile time, then type compatibility is ensured, but adaptability to different product versions is lost
Solution Approach 1:
The patent introduces a type adapter as an intermediary component that sits between the client code and the server object. This adapter provides the necessary type information and method signatures that the client code expects, while actually routing calls to the real server object. This resolves the contradiction by providing static-type compatibility to the client through the adapter interface, while allowing the actual server object to be any compatible implementation, thus enabling version adaptability.
Solution Approach 2:
The type adapter creates a copy or proxy of the expected type interface. It implements the same methods and properties as the original server object type, providing a faithful reproduction of the type signature. This allows client code to interact with the adapter as if it were the real object, ensuring type compatibility while the adapter handles the actual communication with the server object, enabling version flexibility.
2Adaptability or versatility
If dynamic binding is used at runtime, then version compatibility is improved, but access to type information is lost
Solution Approach 1:
The type adapter serves as an intermediary that bridges dynamic and static binding requirements. It provides the type information that would normally be available through static compilation, while the actual server object can be dynamically selected at runtime. The adapter implements the expected type interface and provides method signatures, property types, and event signatures that satisfy the client's type information needs, while allowing runtime polymorphism.
Solution Approach 2:
The patent replaces the mechanical requirement for direct type information access with a simulated type information interface. Instead of requiring the client to directly access the server object's type metadata, the type adapter provides a substitute interface that mimics the expected type structure. This substitution allows dynamic binding to work while preserving the appearance of static type information availability.
3Adaptability or versatility
If remote access is enabled across application domains, then versatility is improved, but complexity of the system increases
Solution Approach 1:
The type adapter acts as an intermediary that simplifies remote access complexity. It handles the complexity of cross-application domain communication, type marshaling, and method invocation routing. The client code interacts with the simple adapter interface, while the adapter manages the complex interactions with the remote server object, including obtaining type information from the server domain and routing method calls appropriately.
Solution Approach 2:
The patent segments the remote access functionality into separate components: the type adapter that handles type information and method signatures, the proxy that handles method invocation, and the actual server object that implements the business logic. This segmentation allows each component to be optimized independently and reduces the complexity burden on any single part of the system while enabling versatile remote access.
Data Source
AI summary
A system allows a non-virtual method of a base class inherited by a derived class to be effectively overridden so that code developed to access the method via the base class accesses the overriding behavior. The system replaces an instance of the derived class with a dynamic object and transparent object with the transparent object appearing to provide to invoking code an implementation of the derived class. Upon receiving an invocation of a method, the transparent proxy directs the invocation to the dynamic object by invoking an invoke method of the dynamic object passing an indication of the invoked method of the transparent object. The dynamic object may be an instance of a dynamic class that inherits a real class with a virtual invoke method. The dynamic class overrides the invoke method to provide overriding behavior.


