Design Patterns

Design Patterns

University

17 Qs

quiz-placeholder

Similar activities

CIT214 Final Exam - Test I

CIT214 Final Exam - Test I

University

15 Qs

CS8592-OOAD-UNIT II- QUIZ III

CS8592-OOAD-UNIT II- QUIZ III

University

20 Qs

APA1 - Friday

APA1 - Friday

University

17 Qs

Sylhet- Mobile App Game & Job Festival 2023 - QUIZ

Sylhet- Mobile App Game & Job Festival 2023 - QUIZ

University

20 Qs

Object Oriented Programming Quiz

Object Oriented Programming Quiz

University

15 Qs

OOP Test

OOP Test

University

22 Qs

AJP - UNIT I - DESIGN PATTERNS

AJP - UNIT I - DESIGN PATTERNS

University

20 Qs

OOP in Python

OOP in Python

University

15 Qs

Design Patterns

Design Patterns

Assessment

Quiz

University

Medium

Created by

Codecje Codecje

Used 361+ 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?