Quiz
Design Patterns
Crie uma conta grátis para terminar este quiz
Salve seu progresso e veja sua nota final.
Já tem uma conta? Inicie sessão
Perguntas do quiz (19)
1Adapter is:
- Acreational pattern which defines an interface for creating objects, but delegates the actual responsibility for selecting the class and instantiating the object to a subclass
- Bstructural pattern that lets you add responsibilities to an object dynamically
- Cstructural pattern that adapts a class with an incompatible interface to fit your needs
2Observer is:
- Abehavioral pattern that allows an object to notify other objects when it changes (without knowing what the other objects are)
- Bbehavioral pattern that lets subclasses redefine certain steps of an algorithm without changing the algorithm's structure.
(Similar to Strategy but allows steps to be changed instead of whole implementation) - Cbehavioral pattern that allows a class to use different variants of an algorithm
3Factory method is:
- Acreational pattern which defines an interface for creating objects, but delegates the actual responsibility for selecting the class and instantiating the object to a subclass
- Bcreational pattern which provides an interface for creating families of related(or dependent) objects without specifying their concrete classes
- Cbehavioral pattern that lets subclasses redefine certain steps of an algorithm without changing the algorithm's structure.
(Similar to Strategy but allows steps to be changed instead of whole implementation)
4Abstract Factory is:
- Acreational pattern which provides an interface for creating families of related(or dependent) objects without specifying their concrete classes
- Bstructural pattern that lets you add responsibilities to an object dynamically
- Cbehavioral pattern that allows a class to use different variants of an algorithm
5Decorator is:
- Astructural pattern that lets you add responsibilities to an object dynamically
- Bbehavioral pattern which encapsulates a request as an object
- Cstructural pattern that adapts a class with an incompatible interface to fit your needs
6Command is:
- Abehavioral pattern which encapsulates a request as an object
- Bbehavioral pattern that allows a class to use different variants of an algorithm
- Cbehavioral pattern that allows an object to notify other objects when it changes (without knowing what the other objects are)
7Use case for abstract factory:
- Asystem should be independent of product creation
- Bwant to configure with multiple families of products
- Cwant to ensure that a product family is used together
- Dwhen an algorithm consists of varying and invariant parts that must be customized
- Ea class can't anticipate the class of objects it must create
8Use cases for factory method:
- Aa class can't anticipate the class of objects it must create
- Ba class wants its subclasses to specify the objects it create
- Cyou need to use several subclasses, but its impractical to adapt their interfaces by subclassing each one
- Dmany classes differ only in their behavior
- Ewant to configure with multiple families of products
9Use cases for decorator:
- Aadd responsibilities to individual objects dynamically and transparently
- Bwhen responsibilities for objects can be withdrawn
- Cwhen extension of functionality by subclassing is impractical
- Dparameterize objects by an action to perform
- Eclient needs different variants of an algorithm
- Fsystem should be independent of product creation
10Use cases for command:
- Aparameterize objects by an action to perform
- Bspecify, queue, and execute requests at different times
- Cstructure a system around high-level operations built out of primitives
- Dyou want to create a reusable class that cooperates with unrelated classes that might not have compatible interfaces
- Eclient needs different variants of an algorithm
- Fsystem should be independent of product creation
11Bridge pattern:
- ADecouples an abstraction from an implementation so the two can vary independently
- BProvides a unified interface to a set of interfaces in a subsystem. Facade defines a higher-level interface making the subsystem easier to use.
- CProvide a surrogate or placeholder for another object to control access to it
12Mediator is:
- ADefining an object that encapsulates how a set of objects interact.
- BA way for controlling communication between classes or entities.
- CUse sharing to support large numbers of fine-grained objects efficiently
- DCompose objects into tree structures to represent part-whole hierarchies
13Chain of Responsibility is:
- AAvoid coupling the sender of a request to its receiver by giving more than one object a chance to handle the request
- BEncapsulate a request as an object, thereby letting you parameterize clients with different requests, queue or log requests, and support undoable operations
- CProvide a way to access the elements of an aggregate object sequentially without exposing its underlying representation
- DDefine an object that encapsulates how a set of objects interact
14Facade:
- AProvides a unified interface to a set of interfaces in a subsystem
- BConverts the interface of a class into another interface clients expect
- CAttaches additional responsibilities to an object dynamically
- DProvides a surrogate or placeholder for another object to control access to it
15Flyweight:
- AUses sharing to support large numbers of fine-grained objects efficiently
- BSpecifies the kinds of objects to create using a prototypical instance, and create new objects by copying this prototype
- CDefines the skeleton of an algorithm in an operation, deferring some steps to subclasses
- DRepresents an operation to be performed on the elements of an object structure
16Proxy:
- AProvides a surrogate or placeholder for another object to control access to it
- BHas a simulated object that mimics the behavior of a real object in controlled ways1
- CSpecify the kinds of objects to create using a prototypical instance, and create new objects by copying this prototype
- DDefine the skeleton of an algorithm in an operation, deferring some steps to subclasses
17Visitor:
- ALets you define a new operation without changing the classes of the elements on which it operates
- BAttach additional responsibilities to an object dynamically
- CDecouple an abstraction from an implementation so the two can vary independently
- DDefine a family of algorithms, encapsulate each one, and make them interchangeable
18Model-View-ViewModel:
- ADecouples the model from the view, uses data binding from the view to the middle layer, and allows UI/UX designers to work almost independently from application developers
- BDefine a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically
- CRepresent an operation to be performed on the elements of an object structure
19Data Access Object:
- AProvides an abstract interface to some type of database or other persistence mechanism.
- BDefines a family of algorithms, encapsulate each one, and make them interchangeable
- CCompose objects into tree structures to represent part-whole hierarchies
Informações
- Descrição
- Final Software Engineering Quiz sobre Design Patterns, criado por Erica Solum em 15-03-2016.
- Autor
- Erica Solum
- Idioma
- English
- Visualizações
- 921
- Etiquetas
- Avaliação
- 5,0 de 5 · 2 avaliações Avalie este quiz