Quiz
DesignPatterns 1
Este quiz tem tipos de pergunta que abrem no player de sempre.
Perguntas do quiz (7)
1-Strategy Pattern-
Patterns [blank_start]recur[blank_end](5) in many applications
[blank_start]Encapsulate[blank_end](11) what varies
Favor [blank_start]Composition[blank_end](11) over inheritance
Java IO , Networking, Sound [blank_start]APIs[blank_end](4)
Most patterns follow from OO [blank_start]Principles[blank_end](10)
High level libraries [blank_start]Frameworks[blank_end](10)
Pattern that fixed the simulator: [blank_start]Strategy[blank_end](8)
Program to [blank_start]Interface[blank_end](10), not an implementation
Patterns go into your [blank_start]brain[blank_end](5)
Development constant [blank_start]change[blank_end](6)
Patterns give us a shared [blank_start]vocabulary[blank_end](10)- Arecur
- BEncapsulate
- CComposition
- DAPIs
- EPrinciples
- FFrameworks
- GStrategy
- HInterface
- Ibrain
- Jchange
- Kvocabulary
2-Singleton Pattern-
It was one of a kind [blank_start]CLASSLOADERS[blank_end](12, 2 words (no space))
A singleton is a class that manages an instance of [blank_start]ITSELF[blank_end](6, 2 words (no space))
If you don’t need to worry about lazy instantiation, you can create your instance [blank_start]STATICALLY[blank_end](10)
Prior to 1,2 this can eat your Singletons [blank_start]GARBAGECOLLECTOR[blank_end](16, 2 words (no space))
The singleton was embaressed it had no public [blank_start]CONSTRUCTOR[blank_end](11)
The classic implementation doesn’t handle this [blank_start]MULTITHREADING[blank_end](14)
Singleton ensures only one of these exist [blank_start]INSTANCE[blank_end](8)
Singleton provides a single instance and [blank_start]GLOBALACCESPOINT[blank_end](16, 3 words (no space))
The singleton pattern has one [blank_start]CLASS[blank_end](5)
Flawed multithreading approach if not using Java 1.5 [blank_start]DOUBLECHECKED[blank_end](13, 2 words (no space))
One advantage over global variables: [blank_start]LAZY[blank_end](4) creation
To totally defeat the new constructor, we have to declare the constructor [blank_start]PRIVATE[blank_end](7)- ACLASSLOADERS
- BITSELF
- CSTATICALLY
- DGARBAGECOLLECTOR
- ECONSTRUCTOR
- FMULTITHREADING
- GINSTANCE
- HGLOBALACCESPOINT
- ICLASS
- JDOUBLECHECKED
- KLAZY
- LPRIVATE
3-Command Pattern-
Role of costumer in the command pattern: [blank_start]CLIENT[blank_end](6)
Our first command object controlled this [blank_start]LIGHT[blank_end](5)
The waitress was one [blank_start]INVOKER[blank_end](7)
A command [blank_start]BINDS[blank_end](5) a set of actions and a receiver
Invoker and receiver are [blank_start]DECOUPLED[blank_end](9)
Act as the receivers in the remote control [blank_start]VENDORCLASSES[blank_end](13)
All command provide this: [blank_start]EXECUTE[blank_end](7)
Carries out a request: [blank_start]RECEIVER[blank_end](8)
Object that knows the actions and the receiver [blank_start]COMMAND[blank_end](7)
Another thing command can do: [blank_start]UNDO[blank_end](4)
Object that knows how to get things done [blank_start]RECEIVER[blank_end](8)
A command encapsulates this [blank_start]AREQUEST[blank_end](8, 2 words)- ACLIENT
- BLIGHT
- CINVOKER
- DBINDS
- EDECOUPLED
- FVENDORCLASSES
- GEXECUTE
- HRECEIVER
- ICOMMAND
- JUNDO
- KRECEIVER
- LAREQUEST
4-Factory Pattern-
In factory method,each franchise is a [blank_start]CONCRETECREATOR[blank_end](15, 2 words (no space))
We used [blank_start]OBJECTCOMPOSITION[blank_end](17, 2 words (no space)) in Simple Factory and Abstract Factory and ine-herintance in Factory
Abstract Factory creates a [blank_start]FAMILY[blank_end](6) of product
In factory method, who decides which class to instantioate: [blank_start]SUBCLASS[blank_end](8)
Not a real factory pattern but handy nonetheless: [blank_start]SIMPLEFACTORY[blank_end](13, 2 words (no space))
Role of PizzaStore in Factory Method Pattern: [blank_start]CREATOR[blank_end](7)
In abstract factory, each ingredient factoryis a [blank_start]CONCRETEFACTORY[blank_end](15, 2 words (no space))
When you use new keyword, you are programming to an [blank_start]IMPLEMENTATION[blank_end](14)
Ethan likes this kind of pizza NYSTYLE createPizza() is a [blank_start]FACTORYMETHOD[blank_end](13, 2 words (no space))
In factory Method, the PizzaStore and the concrete pizza class all depend on this abstraction [blank_start]PIZZA[blank_end](5)
When a classs instantiates an object from a concrete class, it’s [blank_start]DEPENDENT[blank_end](9) on that object
All factory patterns allow us to [blank_start]ENCAPSULATE[blank_end](10) object creation- ACONCRETECREATOR
- BOBJECTCOMPOSITION
- CFAMILY
- DSUBCLASS
- ESIMPLEFACTORY
- FCREATOR
- GCONCRETEFACTORY
- HIMPLEMENTATION
- IFACTORYMETHOD
- JPIZZA
- KDEPENDENT
- LENCAPSULATE
5-Adapter Pattern-
True of false, adapters can only wrap one object: [blank_start]FALSE[blank_end]
Decorator called adapter this [blank_start]SIMPLEPASSTHROUGH[blank_end](17, 3 words)
One advantage of facade: [blank_start]DECOUPLING[blank_end](10)
Priciple that wasn’t as easy as it sounded [blank_start]LEASTKNOWLEDGE[blank_end](14, 2 words)
An adapter [blank_start]CONVERTS[blank_end](8) an interface
A [blank_start]DECORATOR[blank_end](9) adds new behavior
Masquerading as a duck [blank_start]TURKEY[blank_end](6)
Example that violatest he principle of least knowledge: System.out [blank_start]PRINTLN[blank_end](7)
If in europe you might need one of these [blank_start]ACADAPTER[blank_end](9, 2 words)
Adapter with two roles [blank_start]TWOWAY[blank_end](6, 2 words)
adapter client uses the [blank_start]TARGET[blank_end](6) interface
Facade still [blank_start]ALLOWS[blank_end](6) low level acces
Disadvantage of the principle of least knowledge: too many [blank_start]WRAPPERS[blank_end](8)
A [blank_start]FACADE[blank_end](6) simplifies an interface
An adapter and a decorator can be said to [blank_start]WRAP[blank_end](4) an object- AFALSE
- BSIMPLEPASSTHROUGH
- CDECOUPLING
- DLEASTKNOWLEDGE
- ECONVERTS
- FDECORATOR
- GTURKEY
- HPRINTLN
- IACADAPTER
- JTWOWAY
- KTARGET
- LALLOWS
- MWRAPPERS
- NFACADE
- OWRAP
6-Template Pattern-
Strategy uses [blank_start]Composition[blank_end](11) Rather than inheritance
The Template method pattern uses [blank_start]Inheritance[blank_end](11) To defer implementation to other classes.
Don’t call us, we’ll call you is known as the [blank_start]PrincipleHollywoord[blank_end](19, 2 words)
A template method defines the steps of an [blank_start]Algorithm[blank_end](9)
The template method is usually defined in an [blank_start]Abstract[blank_end](8) class
[blank_start]Optional[blank_end](8) Algorithm steps are implemented by hook methods
Factory method is a [blank_start]specialization[blank_end](14) of Template method.
The steps in the algorithm that must be supplied by the subclasses are usually declared: [blank_start]Abstract[blank_end](8)
A method in the abstract superclass that does nothing or provies deafult behavior is called a [blank_start]Hook[blank_end](4) method
Big headed pattern: [blank_start]Strategy[blank_end](8)
The Arrays class implements its template method as a [blank_start]Static[blank_end](6) method- AComposition
- BInheritance
- CPrincipleHollywoord
- DAlgorithm
- EAbstract
- FOptional
- Gspecialization
- HAbstract
- IHook
- JStrategy
- KStatic
7-Observer Pattern-
Observable is a [blank_start]CLASS[blank_end](5) not a interface
Ron was both an Observer and a [blank_start]SUBJECT[blank_end](7)
You say you want to keep your coupling [blank_start]Loose[blank_end](5)
Implements this method to get notified [blank_start]UPDATE[blank_end](6)
CurrentConditionsDisplay implements this interface [blank_start]OBSERVER[blank_end](8)
How to get yourself off the Observer list [blank_start]REMOVEOBSERVER[blank_end](14, 2 words)
[blank_start]OBSERVABLE[blank_end](10) can manage your observers for you
Java framework with a lot of observers [blank_start]SWING[blank_end](5)
You forgot this: [blank_start]SETCHANGED[blank_end](10, 2 words) if you’re not getting notified when you think you should be
Observers like to be [blank_start]NOTIFIED[blank_end](8) when something new happens
The WeatherData class [blank_start]IMPLEMENTS[blank_end](10) the Subject interface
One subject likes to talk to [blank_start]MANY[blank_end](4) observers
Don’t coun’t on this: [blank_start]ORDER[blank_end](5) for notification
Subject initially wanted to [blank_start]PUSH[blank_end](4) al the data to Observer down
Temperature, humidity and [blank_start]PRESSURE[blank_end](8)
Observers are [blank_start]DEPENDENT[blank_end](9) on the Subject
Program to an [blank_start]INTERFACE[blank_end](9) not an implementation
A subject is similar to a [blank_start]PUBLISHER[blank_end](9)- ACLASS
- BSUBJECT
- CLoose
- DUPDATE
- EOBSERVER
- FREMOVEOBSERVER
- GOBSERVABLE
- HSWING
- ISETCHANGED
- JNOTIFIED
- KIMPLEMENTS
- LMANY
- MORDER
- NPUSH
- OPRESSURE
- PDEPENDENT
- QINTERFACE
- RPUBLISHER
Informações
- Descrição
- Quiz sobre DesignPatterns 1, criado por Dtk Turpal em 04-01-2020.
- Autor
- Dtk Turpal
- Idioma
- English
- Visualizações
- 31
- Avaliação
- Ainda sem avaliações Avalie este quiz