O'Reilly logo

The Dart Programming Language by Gilad Bracha

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 7. Reflection

What is reflection? For our purposes, reflection is the ability of a program to examine or modify itself. Reflection can be further subdivided into introspection, the ability of a program to determine its structure while running, and self-modification, its ability to change itself while running.

At this time, Dart only supports introspection. We expect support for self-modification to evolve over time.

Reflection in Dart is based on the concept of mirrors. A mirror, in this context, is an object that reflects another object. Mirrors are a particular form of reflective APIs that have advantages with respect to distribution, deployment and security, which we will discuss in depth in Section 7.2. First, we’ll build up an understanding ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required