The Factory Method
Delegating STARK parameter creation to specialized incantations.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Factory Method
ARCANUM SCHOOL: Conjuration // Spawning
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// CAIRO PATTERN //
trait IParameterFactory {
fn create_parameter() -> felt252;
}
impl FriParameterFactory of IParameterFactory {
fn create_parameter() -> felt252 {
'fri_param'
}
}
impl StarkParameterFactory of IParameterFactory {
fn create_parameter() -> felt252 {
'stark_param'
}
}
Allows sub-schools of proving to define their own specific parameter instantiation, keeping the core ritual generic.
Runic Tags:
#cairo
#design-pattern
#factory-method