Public version: principles, patterns, and generic examples. Internal identifiers and guard scripts are omitted.