User supplied strategies for naming SEP nodes and filters
Introduction
The goal is to use a custom supplied strategy to customise node names and filters in the generated SEP. A custom naming strategy can add semantic value to member names that makes supporting the generated SEP easier. The default auto-generated names can be cryptic and confusing due to their similiarity..
Node naming
A developer can customise the node variable names declared within the final SEP by supplying Fluxtion with an instance of the NodeNameProducer interface. This can greatly help debugging and understanding the SEP code as contextually sensitive identifiers can be used within the SEP in place of the default cryptic auto-generated names. The interface is simple, Fluxtion compiler supplies the instance at generation time and the user returns a String name for the node. A null return delegates to the default auto-naming strategy.
A developer can customise the filter names and comments declared within the final SEP by supplying Fluxtion with an instance of the FilterDescriptionProducer interface. This can greatly help debugging and understanding the SEP code as contextually sensitive identifiers can be used within the SEP in place of the default cryptic auto-generated names. The interface is simple as shown below. The developer returns a FilterDescription which also allows comments to be present at filter sites.
The following example implements node and filter naming strategies. The example code is located here.
Several data handlers are added to the graph in a SEPConfig. Each handler has a filter string, this value will be used to generate the node names in the SEP and the comments on the filters will be customised as well with this strategy:
The generated SEP now has nodes whose names are more human readable due to the naming strategy, see lines 4-6. Filter comments are customised in line with the filter strategy, lines 27, 32 and 37.
The SEP is much easier to map mentally making support a simpler task.