org.apache.royale.compiler.definitions.references.package.html Maven / Gradle / Ivy
Show all versions of compiler Show documentation
This package contains interfaces related to inter-definition references.
Definitions typically refer to other definitions indirectly, by name,
using an IReference
.
This indirection scheme allows definitions to be shared across projects.
This is important because there are many definitions in the core SWCs
that many projects use -- such as the Flash, AIR, and Flex SWCs -- and
it would waste memory to keep of copy of all of them in each project.
For example, consider the UIComponent
class
in framework.swc
, which extends Sprite
,
and consider two Flex projects,
one of which links against playerglogal.swc
and the other links against airglobal.swc
.
In one project, the superclass of UIComponent
is the flash.display.Sprite
class in
playerglobal.swc
; in the other, it is the
flash.display.Sprite
class in airglobal.swc
.
(They could be different, even though they have the same name.)
Therefore, if we want to have a project-independent class definition
for UIComponent
, it cannot refer directly to the definition
for its superclass. Instead, it stores an IReference
to
flash.display.Sprite
, which gets resolved differently
in the two projects.
In some cases, is definition can keep direct references to other definitions.
For example, a function definition keeps direct references to the definitions
for its parameters, and a class definition keeps direct references to the
definitions for its events, styles, and effects.