The Discovery Channel Telescope is a 4.3m astronomical research telescope in northern Arizona constructed through a partnership between Discovery Communications and Lowell Observatory. The control software for the telescope and observatory systems consists of stand-alone, state-based components that respond to triggers (external signals or internal data changes). Component applications execute on Windows, real-time, and FPGA targets. The team has developed a template for a system component, the implementation of which has yielded large gains in productivity, robustness, and maintainability. These benefits follow from the dependence of the template on common, well-tested code, allowing a developer to focus on application-specific particulars unencumbered by details of infrastructure elements such as communication, and from the separation of concerns the architecture provides, ensuring that modifications are straightforward, separable, and consequently relatively safe. We describe a repeatable design process for developing a state machine design, and show how this translates directly into a concrete implementation utilizing several design patterns, illustrating this with examples from components of the functioning active optics system. We also present a refined top-level state machine design and rules for highly independent component interactions within and between hierarchies that we propose offer a general solution for large component-based control systems.