发明名称 Simulation of static members and parameterized constructors on an interface-based API
摘要 Embodiments are directed to providing a simulation of a type-level construct on an interface instance and to maintaining a token-based event handling system. In one scenario, a computer system instantiates an interface instance that includes an instance object and multiple instance members. The computer system also instantiates a separate typed object which is configured to maintain one or more simulated type-level parameterized constructors. The computer system then associates the instantiated interface instance with the separate typed object. The typed object routes method invocations from the interface instance to various simulated type-level parameterized constructors and static members of the type.
申请公布号 US9183001(B2) 申请公布日期 2015.11.10
申请号 US201213350552 申请日期 2012.01.13
申请人 Microsoft Technology Licensing, LLC 发明人 Farkas Shawn;Kaplan Jesse D.;Prosek Ladislav;Byers Richard M.;Byington Ryan A.
分类号 G06F9/45;G06F9/44 主分类号 G06F9/45
代理机构 代理人 Sullivan Kevin;Hoff Aaron;Minhas Micky
主权项 1. At a computer system including at least one processor and a memory, a computer-implemented method for providing a simulation of a type-level construct on an interface instance, the method comprising: instantiating an interface instance comprising an instance object and one or more instance members; instantiating a separate typed object which is configured to maintain one or more simulated type-level parameterized constructors, the simulated type-level parameterized constructors having associated parameters; scanning a plurality of interface instances to identify an interface instance that provides a method having a specified set of parameters, the identified method being matched to the parameters of the simulated type-level parameterized constructors to determine an appropriate interface instance to dispatch method calls against; associating the instantiated interface instance with the separate typed object, wherein the separate typed object is configured to route method invocations for the identified method from the interface instance to one or more simulated type-level parameterized constructors and static members of the type; and simulating a type-level parameterized constructor by redirecting attempts to execute the static members to the static members' associated interface instance, the redirection allowing a runtime to simulate the presence of static members over the top of the interface instance associated with the separate typed object by at least: identifying a callback method on the interface instance;creating a delegate type with an invoke method that has an identical signature to a signature of the callback method;upon determining that the delegate has been invoked, forwarding the callback method to an application binary interface (ABI) method; andreturning the result of the callback method as the result of the delegate invocation, such that the runtime provides a delegate API experience over an interfaced ABI.
地址 Redmond WA US