2. What is a Design Pattern? It is a known solution to commonly occurring problems or scenarios in software applications. A kind of a template or structure on which one can code the application.
3. Why use a Design Pattern? Reduces development time, as known solutions are used instead of reinventing the wheel. Optimizes the application in terms of: Maintenance Scalability Re-usability
5. Singleton Used in applications when only a single instance of a resource is required. (Ex: Database connection)
6. MVC Most commonly used design pattern. Separates the business logic and presentation logic. Uses Controller for interaction between Model and View.
7. Factory Method Object oriented creational pattern. Method is used to create and initiate objects for classes. An interface is defined for creating an object, but the subclasses decide which class to instantiate.
8. Observer Pattern Allows one object (the observer) to watch another (the subject). It decouples the observer from the subject. When the subject generates an event, it is passed to each of its observers.
10. Choosing a Design Pattern Analyze the requirements. Understand the nature of the problem Determine how a particular design pattern solves that problem.