Few options here. Could have a separate EncoderFactory (imagine the case where .reverseEncoder or .zero is placed before .createEncoder). This would solve the issue by enforcing how encoders are created. On the other hand, I could just put everything in the encoder constructor, but this might be somewhat clunky.
Few options here. Could have a separate EncoderFactory (imagine the case where .reverseEncoder or .zero is placed before .createEncoder). This would solve the issue by enforcing how encoders are created. On the other hand, I could just put everything in the encoder constructor, but this might be somewhat clunky.