100% de satisfacción garantizada Inmediatamente disponible después del pago Tanto en línea como en PDF No estas atado a nada 4.2 TrustPilot
logo-home
Examen

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

Puntuación
-
Vendido
-
Páginas
28
Grado
A+
Subido en
23-02-2025
Escrito en
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.

Mostrar más Leer menos
Institución
Advanced Object Oriented Programming
Grado
Advanced Object Oriented Programming










Ups! No podemos cargar tu documento ahora. Inténtalo de nuevo o contacta con soporte.

Escuela, estudio y materia

Institución
Advanced Object Oriented Programming
Grado
Advanced Object Oriented Programming

Información del documento

Subido en
23 de febrero de 2025
Número de páginas
28
Escrito en
2024/2025
Tipo
Examen
Contiene
Preguntas y respuestas

Temas

Vista previa del contenido

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
Accede al documento completo:

100% de satisfacción garantizada
Inmediatamente disponible después del pago
Tanto en línea como en PDF
No estas atado a nada

Conoce al vendedor
Seller avatar
Quizlettt

Documento también disponible en un lote

Conoce al vendedor

Seller avatar
Quizlettt Nursing
Seguir Necesitas iniciar sesión para seguir a otros usuarios o asignaturas
Vendido
0
Miembro desde
10 meses
Número de seguidores
0
Documentos
291
Última venta
-

0.0

0 reseñas

5
0
4
0
3
0
2
0
1
0

Recientemente visto por ti

Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes