摘要 |
Objects in computing environments are often instantiated based on a class definition that is statically declared at design time, but such instantiation limits the flexibility of the objects so created. Objects may also be composed at runtime through a series of invocations of a reflection programming interface, but reflection techniques may be computationally expensive, and the generation of many objects at runtime based on a single object definition may redundantly invoke the reflection programming interface. As provided herein, when requested to generate a new object at runtime based on an object definition, the host environment may instead automatically generate a factory method (via reflection) using the object definition, and may invoke the factory method to compose the object. The factory method may also be cached with the object definition to facilitate the composing of additional objects based on the same object definition, thereby economizing computing resources and improving system performance.
|