A method, system, and apparatus for implementing object interfaces at
runtime are provided. According to the method, a request is received for
a resource that includes a client side object that supports an object
interface. In response to the request, program code is generated that
implements the interface. Once the program code implementing the object
interface has been generated, the requested resource and the program code
implementing the object interface are returned in response to the request
for the resource. An intermediary object for mediating communication
between objects is also generated and returned in response to the
request. If the object interface implements an interface for consuming
data, the object interface registers itself with the intermediary object
as an event consumer. If the object interface implements a provider
interface, the object interface calls the intermediary object in response
to the occurrence of a specified type of event.