Design Patterns

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/24

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

25 Terms

1
New cards

What are Design Patterns?

A software design pattern is a reusable, general solution to a common software design problem.

2
New cards

Why Use Design Patterns?

Design patterns provide standardized solutions to common problems, which reduces code duplication, improves maintainability, enhances scalability, and encourages flexibility and loose coupling. They also improve code readability and help isolate frequently changing parts of the system, improving encapsulation.

3
New cards

What are Creational Design Patterns?

Creational design patterns generalize the act of object creation, making it more flexible and decoupled from the application.

4
New cards

What is the Singleton pattern?

The Singleton pattern ensures that only one instance of a class exists.

5
New cards

What is the Factory Method pattern?

The Factory Method pattern delegates the creation of objects to subclasses.

6
New cards

What is the Abstract Factory pattern?

The Abstract Factory pattern creates families of related objects without specifying their concrete classes.

7
New cards

What is the Builder pattern?

The Builder pattern constructs complex objects step by step.

8
New cards

What is the Prototype pattern?

The Prototype pattern creates new objects by copying an existing object.

9
New cards

What are Structural Design Patterns?

Structural design patterns focus on class and object structure, ensuring that objects are combined efficiently.

10
New cards

What is the Adapter pattern?

The Adapter pattern allows incompatible interfaces to work together.

11
New cards

What is the Bridge pattern?

The Bridge pattern separates abstraction from implementation, providing flexibility.

12
New cards

What is the Composite pattern?

The Composite pattern treats individual and composite objects uniformly, allowing them to be handled similarly in a part-whole hierarchy.

13
New cards

What is the Decorator pattern?

The Decorator pattern dynamically adds behavior to an object without altering its structure.

14
New cards

What is the Facade pattern?

The Facade pattern provides a unified interface to simplify complex subsystems.

15
New cards

What is the Flyweight pattern?

The Flyweight pattern shares objects efficiently to reduce memory usage.

16
New cards

What is the Proxy pattern?

The Proxy pattern controls access to another object, often used for security or lazy initialization.

17
New cards

What are Behavioural Design Patterns?

Behavioural design patterns focus on communication between objects, defining how they interact and pass responsibility.

18
New cards

What is the Functor pattern?

The Functor pattern treats functions as objects, enabling function pointers to be replaced by function objects.

19
New cards

What is the need for Function Pointers and Functors?

Function pointers and functors allow varying how an operation is performed without changing the method implementing the algorithm, decoupling the application from its implementation.

20
New cards

What is the Iterator pattern?

The Iterator pattern provides a way to access elements of a collection sequentially without exposing the internal details of the data structure.

21
New cards

What is the difference between an Iterator and a for-each loop?

An Iterator provides explicit control over how the collection is traversed, while a for-each loop abstracts this process and is simpler to use.

22
New cards

What is the Iterable interface?

The Iterable interface allows an object to be used in a for-each loop, enabling traversal of the collection.

23
New cards

What is the Composite pattern used for?

The Composite pattern is used to create tree-like structures where individual objects and compositions of objects can be treated uniformly, useful for hierarchical data.

24
New cards

What are the key components of the Composite pattern?

The key components are Leaf objects (simple elements) and Composite objects (collections of components), both implementing the same interface.

25
New cards

What is the benefit of using the Composite pattern?

The Composite pattern simplifies the handling of hierarchical structures by allowing both individual objects and composites to be treated uniformly, improving flexibility and extensibility. \