Design patterns for model-based automation software design and implementation