Singleton Pattern in Programming

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

O padrão que garante uma única instância de uma classe é:

  • Builder
  • Prototype
  • Singleton (correct)
  • Facade

Qual design pattern encaminha a criação de objetos para subclasses?

  • Abstract Factory
  • Visitor
  • Factory Method (correct)
  • Proxy

Complete a frase: O padrão ___ permite criar famílias de objetos relacionados sem especificar suas classes concretas.

  • Prototype
  • Builder
  • Abstract Factory (correct)
  • Chain of Responsibility

Qual padrão seria usado para construir um objeto complexo, como um personagem em um jogo, peça por peça?

<p>Builder (C)</p> Signup and view all the answers

Complete a frase: O padrão ___ é útil para criar novos objetos copiando instâncias existentes.

<p>Prototype (A)</p> Signup and view all the answers

Qual padrão transforma a interface de uma classe em outra que o cliente espera?

<p>Adapter (B)</p> Signup and view all the answers

O padrão ___ separa abstração de implementação, facilitando mudanças independentes.

<p>Bridge (C)</p> Signup and view all the answers

Qual design pattern permite tratar objetos individuais e composições de forma uniforme, como uma árvore?

<p>Composite (A)</p> Signup and view all the answers

Você deseja adicionar funcionalidades a um objeto existente sem alterar sua estrutura. Qual padrão seria usado?

<p>Decorator (B)</p> Signup and view all the answers

Complete a frase: O padrão ___ fornece uma interface simplificada para interagir com sistemas complexos.

<p>Facade (B)</p> Signup and view all the answers

Flashcards

Singleton Pattern

Ensures a class has only one instance and provides a global point of access to it.

Factory Method

Defines an interface for creating an object, but lets subclasses decide which class to instantiate.

Abstract Factory

Creates families of related objects without specifying their concrete classes.

Builder Pattern

Separates the construction of a complex object from its representation.

Signup and view all the flashcards

Prototype Pattern

Creates objects by copying existing instances.

Signup and view all the flashcards

Adapter Pattern

Converts the interface of a class into another interface clients expect.

Signup and view all the flashcards

Bridge Pattern

Decouples abstraction from implementation, allowing them to vary independently.

Signup and view all the flashcards

Composite Pattern

Treats individual objects and compositions of objects uniformly.

Signup and view all the flashcards

Decorator Pattern

Adds responsibilities to an object dynamically without altering its structure.

Signup and view all the flashcards

Facade Pattern

Provides a simplified interface to a complex system of objects.

Signup and view all the flashcards

More Like This

Java Singleton Implementations
10 questions
Singleton Class in Programming
10 questions
Patrón Singleton y Code Smells
13 questions
Use Quizgecko on...
Browser
Browser