Design Patterns

Design Patterns

University

17 Qs

quiz-placeholder

Similar activities

JAVA FINAL QUIZ FOR ASSESSMENT

JAVA FINAL QUIZ FOR ASSESSMENT

University

15 Qs

Post Test Week 3

Post Test Week 3

University

15 Qs

Education

Education

University

14 Qs

Java MCQ Test Day-2

Java MCQ Test Day-2

University

20 Qs

Quiz on Java

Quiz on Java

University

12 Qs

CS 122 - Final Examination

CS 122 - Final Examination

University

16 Qs

Laboratory - Week 10 – 11 Facade Pattern

Laboratory - Week 10 – 11 Facade Pattern

University

20 Qs

Midterm Examination 1.1 (Software Design)

Midterm Examination 1.1 (Software Design)

University

15 Qs

Design Patterns

Design Patterns

Assessment

Quiz

University

Medium

Created by

Codecje Codecje

Used 359+ times

FREE Resource

17 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Which text below describes the Template Method pattern best?
Encapsulates interchangeable behaviours and uses delegation to decide which one to use.
Simplifies the interface of a group of classes.
Subclasses decide how to implement steps in an algorithm.
Changes the interface of one or more classes.
Allows (a group of) objects to be notified when some state changes.

2.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What is not a correct statement for the Hollywood Principle?
High-level components control when and how low-level components participate in the computation.
It is a way to prevent dependency rot.
A low-level component never calls a high-level component directly.
Call us, we don't call you.

3.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Media Image
Have a look at the class diagram for the Template Method pattern. What are the appropriate class names?
1. ConcreteClass 2. AbstractClass
1. AbstractClass 2. ConcreteClass

4.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Which text below describes the Strategy Pattern best?
Encapsulates interchangeable behaviours and uses delegation to decide which one to use.
Simplifies the interface of a group of classes.
Provides a way to traverse a collection of objects without exposing the collection's implementation.
Changes the interface of one or more classes.
Client treats collections of objects and individual objects uniformly.

5.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Identify the aspects of your application that vary and separate them from what stays the same. What does that mean?
Define a super class for what varies and let what stays the same extend that super class.
Take what varies and "encapsulate" it so it won't affect the rest of the code.
Put what varies and what stays the same together. Do it so that starting with an abstract class, all other classes inherit in a clever way.
The number of classes should be identical with the number of interfaces.

6.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What is a proper design principle?
Use abstract classes to implement what varies.
Put what varies and what stays the same together. Do ti so that starting with an abstract class, all other classes inherit in a clever way.
Program to an interface, not an implementation.
The number of classes should be identical with the number of interfaces.

7.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Favour composition over inheritance. What does that mean?
HAS-A can be better than IS-A.
IS-A can be better than HAS-A.
Do not use abstract classes.
The number of classes should be identical with the number of interfaces.

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?