100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

Advanced Object Oriented Programming TEST QUESTIONS & ANSWERS ALREADY GRADED A+ 2025 Terms in this set (174) Intent of Command Pattern To encapsulate a function call as an object. Consequence of Command Pattern Decouples objects that invoke a given opera

Rating
-
Sold
-
Pages
28
Grade
A+
Uploaded on
23-02-2025
Written in
2024/2025

Advanced Object Oriented Programming TEST QUESTIONS & ANSWERS ALREADY GRADED A+ 2025 Terms in this set (174) Intent of Command Pattern To encapsulate a function call as an object. Consequence of Command Pattern Decouples objects that invoke a given operation with ones that know how to perform it. Intent of the Interpreter Pattern Define a representation for a languages grammar along with an interpreter that uses the representation to interpret sentences of that language. Consequence of Interpreter Pattern It's easy to change and extend the grammar (generally just add a new class). Intent of the Iterator pattern It provides a way to access elements of an aggregate collection without exposing the underlying representation. Consequence of the Iterator pattern They support variations in the interpretation of a collection or aggregate. With complex collections the desired type of traversal may change and using this pattern makes it easier to change the traversal algorithm. What is a robust iterator? An iterator that ensures that insertions and removals won't interfere with traversal, and does so without copying the collection. What is the intent of the Memento Pattern? Without violating encapsulation (private variables), it allows one to capture and externalize an object's internal state so that the object can later be restored to that state.

Show more Read less
Institution
Advanced Object Oriented Programming
Course
Advanced Object Oriented Programming










Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
Advanced Object Oriented Programming
Course
Advanced Object Oriented Programming

Document information

Uploaded on
February 23, 2025
Number of pages
28
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

Advanced Object Oriented
Programming TEST QUESTIONS &
ANSWERS ALREADY GRADED A+ 2025


Terms in this set (174)

Intent of Command To encapsulate a function call as an object.
Pattern

Consequence of Decouples objects that invoke a given operation with ones that
Command Pattern know how to perform it.

Intent of the Interpreter Define a representation for a languages grammar along with
Pattern an interpreter that uses the representation to interpret
sentences of that language.


Consequence of It's easy to change and extend the grammar (generally just add
Interpreter Pattern a new class).

Intent of the Iterator It provides a way to access elements of an aggregate
pattern collection without exposing the underlying representation.



Consequence of the They support variations in the interpretation of a collection or
Iterator pattern aggregate. With complex collections the desired type of
traversal may change and using this pattern makes it easier to
change the traversal algorithm.




What is a robust iterator? An iterator that ensures that insertions and removals won't
interfere with traversal, and does so without copying the
collection.



Without violating encapsulation (private variables), it
What is the intent of the
allows one to capture and externalize an object's internal
Memento Pattern?
state so that the object can later be restored to that state.

,Consequence of the It provides encapsulation boundaries. And prevents the
Memento Pattern exposure of contents while enabling an object to store its
state.


What is the intent of the To allow an object to alter its behavior when its
State Pattern? internal state changes. The object will appear to
change its class.


Consequence of the State It localizes the state-specific behavior and partitions behavior for
Pattern different states.

What is the intent of the It defines a family of algorithms, encapsulating each one
Strategy Pattern? and then makes them interchangeable. The algorithms
are also decoupled from clients.


Consequence of the They create families of related algorithms and can leverage
Strategy Pattern inheritance to simplify implementation of commonly-used
functionality.


What is the intent of the To define a new operation without changing the classes of
Visitor Pattern? the elements on which it operated to. It represents an
operation to be performed on elements of an object
structure as a class.


Consequence of the The adding of new operations becomes easy as it removes the
Visitor Pattern task of modifying existing classes.

What is the intent of the To compose objects into tree structures and represent part-
Composite Pattern? whole hierarchies. It lets clients treat individual objects and
compositions of objects uniformly.



Consequence of the They define a class hierarchy of primitive and composite
Composite Pattern objects.

Shearing Layer The state in which between layers where they change from
one speed to another. One layer may be changing slower
than another.

, Program to Interface
Two main design principles
Favor Composition over Inheritance


Program to Interface We don't know what something does. In fact it is better
that we don't know as each time an operation happens
there is a different implementation of the interface.
Example: Accept => Turtle, Accept => Visitor


Favor Composition over Composition gives us flexibility like the strategy pattern.
Inheritance Instead of creating subclasses to store priority at compile
time, use a priority class to change it during runtime.



Coupling One class knowing about the other.


Ex. Turn Expression knowing about the Memento.
(coupled). Also Expressions and Visitors.

Cohesion This is good. We want lots of it. When looking at a class or
function, what is the task that we are trying to accomplish?
Putting "PrintStudents" in a priority queue will make it less
cohesive.


The interpreter pattern is False. It is not going to be as efficient as assembly code.
efficient.

Difference between State Structure is the same. State expects that the object should
and Strategy pattern change its state frequently while the Strategy typically does
not.


Is adding a new Visitor Yes but if you add a new type of visit or the grammar
easy? changes, you must go to each visitor class and change the
grammar/new type to visit.


What design pattern Iterator. We don't know the structure because the iterator
reduces coupling handles that.
between classes?
$14.99
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached

Get to know the seller
Seller avatar
Quizlettt

Also available in package deal

Thumbnail
Package deal
Package deal:::Advanced Programming
-
5 2025
$ 82.95 More info

Get to know the seller

Seller avatar
Quizlettt Nursing
View profile
Follow You need to be logged in order to follow users or courses
Sold
0
Member since
10 months
Number of followers
0
Documents
291
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

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

Frequently asked questions