When Are Methods Called?

Some methods are called during both phases and some are ignored during one phase or the other. Perhaps the best example of a method ignored during the Compile phase is FORMAT. There is no need to make data look pretty when you aren’t displaying anything. The table below lists all of the method types and when they are called.

Method Type and Phase of Use

Method type

Compile Phase

Reconstruction Phase

BOOLEAN

BRANCH

BYTE_STREAM_FRAMER


FORMAT


FRAME_TRANSFORMER


NEXT_PROTOCOL


NEXT_PROTOCOL_OFFSET


NEXT_PROTOCOL


NEXT_PROTOCOL_SIZE


POSTPROCESSING

PREPROCESSING

PROCESSING


RETRIEVING_DATA

SIZE

START_BIT

TAG


VERIFY

Why do we care when methods are called? Some methods, like PROCESSING, are the heavy lifters when it comes to modifying data in statics. They are only executed during the compile phase and aren’t necessary in the reconstruction phase. Conversely, the aforementioned FORMAT method might be considered a prime consumer of data in the static. It’s only executed at reconstruction time.

Then there are the methods like RETRIEVE and START_BIT that get executed in both phases. It is wise to put logic in these methods so that the static is not modified during reconstruction. If data is being saved to the static during reconstruction phase from one method call to another within a frame, perhaps that data would be better saved in a DecoderScript variable.