Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 2 out of 5 pages
Exam (elaborations)

CSE 110 Design Patterns Question and answers 100% correct 2025

Document preview thumbnail
Preview 2 out of 5 pages

CSE 110 Design Patterns Question and answers 100% correct 2025 Strategy - correct answer Defines a family of algorithms, encapsulates each one, makes them interchangeable. Lets the algorithm vary independently from clients that use it Encapsulate interchangeable behaviors and use delegation to decide which behavior to use Observer - correct answer one-to-many dependency between objects so that when one object changes state, all of its dependents are modified and updated automatically loosely coupled Decorator - correct answer Attaches additional responsibilities to an object dynamically. Provide a flexible alternative to subclassing for extending functionality Behavior extended without modifying existing code involves a set of decorator classes that are used to wrap concrete components mirror the type of the components they decorate change the behavior o

Content preview

CSE 110 Design Patterns Question and
answers 100% correct 2025
Strategy - correct answer ✔Defines a family of algorithms, encapsulates
each one, makes them interchangeable.


Lets the algorithm vary independently from clients that use it


Encapsulate interchangeable behaviors and use delegation to decide which
behavior to use


Observer - correct answer ✔one-to-many dependency between objects so
that when one object changes state, all of its dependents are modified and
updated automatically


loosely coupled


Decorator - correct answer ✔Attaches additional responsibilities to an object
dynamically. Provide a flexible alternative to subclassing for extending
functionality


Behavior extended without modifying existing code


involves a set of decorator classes that are used to wrap concrete
components


mirror the type of the components they decorate

, change the behavior of their components by adding new functionality before
and/or after (or even in place of) method calls to the component.


typically transparent to the client of the component


don't alter interface, but adds responsibility


Factory - correct answer ✔Defines an interface for creating an object, but
lets subclasses decide which class to instantiate


encapsulate object creation


simple way to decouple clients from concrete classes


relies on inheritance: object creation is delegated to subclasses which
implement the ____ method to create objects


relies on object composition: object creation is implemented in methods
exposed in the ____ interface


promote loose coupling by reducing dependency of your application on
concrete classes


ALLOW CLASS TO DEFER INSTANTIATION TO ITS SUBCLASSES


abstract ____ method is to create families of related objects without having to
depend on their concrete classes

Document information

Uploaded on
July 2, 2025
Number of pages
5
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers
$18.49

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Academia199
3.9
(53)
Sold
374
Followers
209
Items
19942
Last sold
1 day ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions