How would you structure an application using common design patterns such as Singleton, Factory, or Observer?