Advanced Software Engineering: Design Patterns and Best Practices
Your Progress
Cards Studied
0 of 200%
Keep it up! You're making great progress
Mastery Level
0 mastered0%
0 learning•20 not started
Advanced Software Engineering: Design Patterns and Best Practices
20 flashcards
Q1:What are design patterns?
A:Design patterns are standard solutions to common problems in software design that organize code and facilitate code reuse.
Q2:What are the three main categories of design patterns?
A:The three main categories of design patterns are creational, structural, and behavioral.
Q3:What is the Singleton pattern?
A:The Singleton pattern ensures that a class has only one instance and provides a global point of access to that instance.
Q4:What is the Factory Method pattern?
A:The Factory Method pattern defines an interface for creating an object, but lets subclasses alter the type of objects that will be created.
Q5:What does the Strategy pattern enable?
A:The Strategy pattern enables selecting an algorithm’s behavior at runtime by defining a family of algorithms and encapsulating each one.
Q6:What role do interfaces play in design patterns?
A:Interfaces allow design patterns to define contracts that classes can implement, promoting low coupling and high cohesion.
Q7:Can you explain the Observer pattern?
A:The Observer pattern defines a one-to-many dependency between objects, so when one object changes state, all its dependents are notified.
Q8:What is Dependency Injection?
A:Dependency Injection is a design pattern used to implement IoC (Inversion of Control), allowing for better code modularity and testing.
Q9:Why are best practices important in software engineering?
A:Best practices improve software quality, maintainability, and performance by providing guidelines for behavior and code structure.
Q10:What is a design pattern's 'intent'?
A:A design pattern's 'intent' describes the problem it addresses and the essential solution or approach it provides.
Q11:How does the Adapter pattern work?
A:The Adapter pattern allows incompatible interfaces to work together by wrapping an interface around an existing class.
Q12:What is the purpose of the Template Method pattern?
A:The Template Method pattern defines the skeleton of an algorithm in a base class but allows subclasses to redefine certain steps.
Q13:What is the significance of 'separation of concerns' in design?
A:Separation of concerns is a principle that promotes separating different aspects of a program to reduce complexity and increase maintainability.
Q14:What is meant by 'coupling' in software design?
A:Coupling refers to the degree of interdependence between software modules; lower coupling is generally preferred for better maintainability.
Q15:How do design patterns contribute to software scalability?
A:Design patterns promote best practices that allow software systems to adapt to increasing loads and complexities without major redesign.
Q16:What is the Decorator pattern used for?
A:The Decorator pattern allows behavior to be added to individual objects, either statically or dynamically, without affecting the behavior of other objects.
Q17:What is a 'memento'?
A:In software design, a memento is an object that captures and externalizes an object's internal state without violating encapsulation.
Q18:What is the Builder pattern?
A:The Builder pattern separates the construction of a complex object from its representation, allowing the same construction process to create different representations.
Q19:What is a 'design principle'?
A:Design principles are foundational guidelines that inform the design of software components and systems to ensure quality and maintainability.
Q20:What does 'DRY' stand for, and why is it important?
A:DRY stands for 'Don't Repeat Yourself,' and it encourages reducing code duplication, which improves maintainability and reduces errors.
1 of 20
Term
What are design patterns?
Click to reveal answer
Spaceto flip
