Principles, Patterns, and Practices: The Factory Pattern