Computational Reflection

Definition - What does Computational Reflection mean?

Computational reflection is the ability of a program to modify itself while running. The source code of the program is treated as data by itself os that appropriate modifications can be made by the program during runtime. Programs capable of modifying their own source code, or the source code of some other program, during runtime are called metaprograms. Computational reflection allows the programmer to save time implementing some parts of the program, which are generated by the program itself at runtime.

Techopedia explains Computational Reflection

Metaprogramming can be achieved by three methods:

  1. The executing program exposes its own source code to the runtime environment and appropriate changes are introduced in the program. The exposure can be through a direct link to the interpreter in the program or through well-defined external interfaces.
  2. String expressions within the source code trigger certain metaprogramming procedures during runtime.
  3. A general programming transform system applies commands specific to the programming language of the source code on invocation.

One advantage of computationally reflective systems is that the program is adaptable at run time. Any program statement can be changed at run time by means of the reflect statement. This system is far superior to method overriding, where the behavior is determined by the method being called at run time.

Share this:

Connect with us

Email Newsletter

Join thousands of others with our weekly newsletter

The 4th Era of IT Infrastructure: Superconverged Systems
The 4th Era of IT Infrastructure: Superconverged Systems:
Learn the benefits and limitations of the 3 generations of IT infrastructure – siloed, converged and hyperconverged – and discover how the 4th...
Approaches and Benefits of Network Virtualization
Approaches and Benefits of Network Virtualization:
Businesses today aspire to achieve a software-defined datacenter (SDDC) to enhance business agility and reduce operational complexity. However, the...
Free E-Book: Public Cloud Guide
Free E-Book: Public Cloud Guide:
This white paper is for leaders of Operations, Engineering, or Infrastructure teams who are creating or executing an IT roadmap.
Free Tool: Virtual Health Monitor
Free Tool: Virtual Health Monitor:
Virtual Health Monitor is a free virtualization monitoring and reporting tool for VMware, Hyper-V, RHEV, and XenServer environments.
Free 30 Day Trial – Turbonomic
Free 30 Day Trial – Turbonomic:
Turbonomic delivers an autonomic platform where virtual and cloud environments self-manage in real-time to assure application performance.