0% found this document useful (0 votes)
20 views2 pages

Design Patterns Worksheet for COMP 215

Uploaded by

Rutherford paul
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views2 pages

Design Patterns Worksheet for COMP 215

Uploaded by

Rutherford paul
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

COMP 215: Intro to Program Design

Dr. Rebecca Schreib

Name: [Your name]

The following worksheet is based on Module 12.W Pre-Class (Design Patterns I). As
usual, you should create a personal copy of this worksheet, fill it out, and submit it to
Canvas prior to the deadline.

1. Define the following terms:

a. Design pattern: [Your answer]


b. Creational pattern: [Your answer]
c. Structural pattern: [Your answer]
d. Behavioral pattern: [Your answer]

2. Fill in the following chart for the creational and structural design patterns
discussed in the Design Patterns I video.

In what situation(s) What are the key structural


Pattern
is it a good design? feature(s)?

Singleton Pattern [Your answer] [Your answer]

Factory Pattern [Your answer] [Your answer]


(individual version)

Factory Pattern [Your answer] [Your answer]


(polymorphic version)

Builder Pattern [Your answer] [Your answer]

Composite Pattern [Your answer] [Your answer]

Adapter Pattern [Your answer] [Your answer]

3. What is the difference between eager and lazy instantiation in the singleton
design pattern?
[Your answer]

4. The factory and builder patterns are similar in that they are each designed to
make it easier to construct a new instance of an object. What is the key
difference between them? (Hint: It has to do with the nature of the object being
constructed!)
[Your answer]

5. Which of the above questions are you unsure about the answers to? List the
question numbers here so that you remember to discuss them with your group
during class. If you don’t have any questions, you can answer this question with
“N/A” (not applicable).
[Your answer]

6. What other questions do you have related to today’s material that you want to
discuss with your group / the staff during class? If you don’t have any questions,
you can answer this question with “N/A” (not applicable).
[Your answer]

You might also like