logo

Crowdly

Browser

Додати до Chrome

Questions Bank (1230196 total)

The Abstract Factory pattern should be used when:

0%
0%
0%
0%
0%
Переглянути це питання
You are creating a framework for applications that can present multiple documents to the user. Two key abstractions in this framework are the classes Application and Document. Both classes are abstract, and clients have to subclass them to realize their application-specific implementations. To create a drawing application, for example, we define the classes DrawingApplication and DrawingDocument.

The Application class is responsible for managing Documents and will create them as required—when the user selects Open or New from a menu. Because the particular Document subclass to instantiate is application-specific, the Application class can't predict the subclass of Document to instantiate — the Application class only knows when a new document should be created, not what kind of Document to create.

This creates a design problem: The framework must instantiate classes, but it only knows about abstract classes, which it cannot instantiate. What design pattern would you use to solve this problem? Explain your decision.
Переглянути це питання

In the Binary Balanceable Tree example discussed in class, which was the factory method?

0%
0%
0%
0%
0%
Переглянути це питання

The ability of an object reference variable to point

to objects of different types is called:

0%
0%
0%
0%
0%
Переглянути це питання

Why is it desirable to “program to an interface, not

to an implementation”?  

Переглянути це питання

What is wrong with this

implementation of a “double-checked” singleton class? (there are 5 errors in this implementation)

Переглянути це питання

Which singleton variant would you use in each case?

Переглянути це питання

Match the principles with their key idea

Переглянути це питання

Which of these are consequences of the strategy pattern?

100%
100%
0%
100%
100%
Переглянути це питання

Select the design principles that are applied in the Observer Pattern

0%
0%
100%
100%
100%
Переглянути це питання