Final Flashcards

1
Q

This pattern allows an object to alter its behavior when its internal state changes, causing the object to appear as if it alter its class membership, i.e., changed subclasses.

A

State

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

This pattern addresses situations where there are multiple ways of doing the same kind of thing, but with different kinds of input, output, or runtime characteristics and the choice of which way to do it has to be made at runtime

A

Strategy

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

This pattern should not be used an excuse to violate the “no global variables” rule.

A

Singleton

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

An application of this pattern defines a high-level interface that can make a subsystem easier to use.

A

Façade

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

The solution for this pattern creates a multicast-style of communication (which may be method calls), where a sender object does not need to know about the specific receivers and there can be multiple receivers.

A

Observer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

This pattern is also called View-Model-Binder

A

MVVM

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

This pattern is often used in conjuction with the Strategies pattern to leverage reuse amoung concrete strategies

A

Template Method

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Select a creational pattern with class scope, i.e. a pattern who primary purpose is to create objects and whose solution relies primarily on inheritance.

A

Factory Method. If you ignore the inheritence part, then also Factory Idiom.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

The pattern can address the problem of accessing remote object as if they were local and hide the true location of an object

A

Proxy

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

This pattern is useful when an extension can result in an exponential explosion of subclasses.

A

Decorator

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

This pattern has the negative consequence that adding new kinds of product (i.e., classes) may be difficult, i.e., result in lots of changes to existing code

A

Abstract Factory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Select a compound pattern

A

MVC, MVP, MVVM

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

With this pattern, it is easy to add new behaviors to a class of objects

A

State, Visitor, Decorator

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

With this pattern, it is easy to extend a system with a new family of products that parallel existing families of product from a functional perspective.

A

Abstract Factory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

This pattern allows for the attachment of any combination of additional responsibilities to an object at run time.

A

Decorator

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

By itself, the pattern does not enforce encapsulation of components in a subsystem, but makes it easier to work with them.

A

Façade

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

The solution of this pattern has the developer define the skeleton of an algorithm in a method and defer the specifics of some steps of that algorithm to subclasses.

A

Template Method

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

This pattern defines a readable and extensible way to perform operations over a collection of elements, without breaking the encapsulation of the collection or its elements.

A

Visitor, and to a lesser extent Iterator

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Select a pattern that can be implemented with either object (delegation) or class scope (inheritance).

A

Adapter

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

This pattern ensures that a class has only one instance.

A

Singleton

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

The solution proposed by this pattern is to extract from a class (i.e., the context) certain behaviors that represent different algorithms for the same basic kind of operation and then encapsulate them in a hierarchy of classes, where each of concrete classes represents a different algorithm.

A

Strategy

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Consider using this pattern in any system that includes a collection of objects and you need to traverse through that collection

A

Iterator

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

This pattern allows algorithms to be selected at runtime, by defining a family of algorithms, encapsulating each algorithm, and making the algorithms interchangeable within that family.

A

Strategy

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

If generics are not available, then adding a new concrete element types can be hard for the solution of this pattern

A

Visitor

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
This idea involves defining a method (typically a static method) that encapsulates the logic for constructing the right kind of object (typically from specializations of a the class that holds the static method.)
Simply Factory Idiom
26
With the solution of this pattern, each product family is implemented in its own hierarchy.
Abstract Factory
27
This pattern is sometimes called the "Action" or "Transaction" pattern.
Command
28
With this pattern, developers can effectively change an otherwise unchangeable interface.
Adapter
29
With this pattern it is easy to add new operations that operate on a complex object structure
Visitor
30
This pattern is also known as a Wrapper.
Adapter, Decorator
31
This pattern combines the use of Strategy, Composite, and Observers to create three layers of software, but still results in some cyclic dependencies
MVC
32
This pattern is useful in any system where one layer of software needs to perform a specific set of actions on objects in another layer of software, particularly if those actions need to be asynchronous, logged, or undone.
Command
33
The solution of this pattern is used in the solution for the Decorator Pattern, but addresses a more generic problem.
Composite
34
This pattern can be used in multiple possible contexts, but the most common is graphical user interfaces, where multiple displays need to show state information about the same object(s).
Observer
35
A disadvantage of this pattern is that it might make the design overly general. Specifically, it might create a bloated interface for the base component and therefore, cause uncessary complexity in concrete components.
Composite
36
This pattern provides a unified interface to a set of components in a subsystem that allows for easy and coordinated use of those components
Façade
37
Select a pattern that is often used with Visitor
Iterator
38
This pattern allows clients to treat aggregate objects and subpart objects uniformly.
Composite
39
This pattern is sometimes also called the "Policy Pattern"
Strategy
40
This is an architectural design pattern that prescribes three loosely coupled layers of software, connected via bindings
MVVM
41
The pattern provides a surrogate placeholder for another objects for the purpose of controlling access to that object in some way.
Proxy
42
This pattern localizes and encapsulates state-specific behavior for a class of objects
State
43
This idea can be used when a component needs to create an object, but doesn't directly need to know the type of object, as long as it adhers to an interface abstraction.
Simply Factory Idiom
44
This pattern requires designers to separate intrinsic from extrinsic state for a class of objects.
Flyweight
45
This pattern is useful when developing a class library or framework and when developers of specific applications need to customize how certain kinds of objects are created
Factory Method
46
This pattern describes how to support a large number of objects that have common state information
Flyweight
47
This pattern may help designers reduce the space required to manage a large number of objects.
Flyweight
48
A pattern, whose solution may result in a long delegation- chain at runtime
Decorator, Composite
49
The solution to this pattern includes a base class or interface with methods for subscribing and unsubscribing
Observer
50
This pattern focuses on the formation of complex, recursive object structures
Composite
51
Use this pattern when you want to create a reusable class that coorperates with unrelated or unforeseen classes, that is, classes that don't necessarily have compatible interfaces.
Adapter
52
Select one of the patterns or idioms that focus on creating an object
Simply Factory, Factory Method, Abstract Factory
53
This pattern can simplified dependencies between objects when the notification of state changes are a primary concern
Observer
54
This pattern addresses the problem of how to encapsulate state-specific behavior as objects in a way that increases the cohesion and extensibility of X, without creating undue coupling
State
55
One of the participants in this pattern is a "leaf".
Composite
56
This pattern can use defer the actual creation (or copying) of a complex object until it is needed.
Proxy
57
Select one of two patterns that have similar structure diagrams and rely on a recursive data structure to organize an open-ended number of objects. They have distinct but complimentary intents, and are therefore often used in concert with each other.
Decorator, Composite
58
This pattern defines an interface for creating an object, but lets subclasses decide which class to instantiate.
Factory Method
59
This pattern helps developers implement "virtual constructors".
Factory Method
60
This pattern's solution includes an Invoker.
Command
61
One of the negative consequences of this pattern is that clients may experience unexpectedly long delays when changing the state of a target object.
Observer, Proxy, and possibly the Command if an Invoker is not used
62
Select a pattern whose intend is to help with the development, testing, and maintenance of user interfaces.
MVC, MVP, MVVM
63
This pattern is also known as "surrogate".
Proxy
64
This pattern has two variations, one called Supervising Controller and another called Passive View.
MVP
65
Select one pattern that can make unit testing simplier.
Any, except perhaps the singleton which can make automated testing harder in some frameworks
66
Use this pattern when you want to use an existing class, but its interface does not match the one you need.
Adapter
67
Select a pattern whose solution(s) rely only on inheritance.
Template Method, Factory Method
68
This pattern lets subclasses redefine parts of an algorithm without changing the algorithm's structure.
Template Method
69
This pattern provides an interface for creating objects from families of parallel class hierarchies, particularly in the context of cross-platform development.
Abstract Factory
70
This pattern encapsulates actions, e.g., method calls, in objects, creating opportunities to perform them asynchronously and to make them “undoable” and repeatable
Command
71
Select a pattern that relies on delegation via aggregation but should not, on its own, result in long chains of delegation
Flyweight, Adapter (Object), Proxy
72
This patterns can be used to provide a global point of access to something like system-wide concrete factory.
Singleton
73
This pattern is useful when the system needs to be independent of how its products are created, composed, and represented and the class to instantiate has to be determined at runtime.
Prototype
74
Select a pattern that can help create layers or subsystems that can be easily replaced or swapped out for some other implementation
Proxy, Abstract Factory, Command, Adapter, and even Façade if there is no other couple to the layer or subsystem that doesn't go through the Façade
75
Select a pattern used as part of MVC
Strategy, Composite, Observer
76
This pattern may have the negative consequence of producing a lot of small objects that all represent one real- world or problem domain object.
Decorator
77
This pattern provides a way to access the elements of a collection sequentially without exposing the collection’s underlying implementation
Iterator
78
This pattern can be used to create "smart references"
Proxy
79
Events in C# are an implementation of this pattern, at least at a conceptual level.
Observer
80
Characterized by the statement "Every object is an unique entity in the university, distinguished by its properties"
Object Identity
81
Grouping objects together into sets based on common properties helps manage complexity. We do this during analysis to better understand the problem and during design to help structure a solution.
Classification
82
Identifying an individual design decision and then implementing that decision in one place.
Localization of Design Decisions
83
The act of hiding or placing a decision decision inside appropriate software components.
Encapsulation
84
The act of summarizing or generalizing something to focus on the ideas that are most relevant to a purpose, or view of a complex thing that leaves out unnecesary details
Abstraction
85
The manner and degree of interdependence between software components. Less of this makes for more maintainable and reusable software.
Coupling
86
The degree to which the elements of a component belong together. More of this reduce complexity and increases maintainabiltiy and reusability.
Cohesion
87
Software components should be extensible, but not modifiable.
Open/Closed Principle
88
Abstract components should not depend on detail components.
Dependency Inversion
89
A process by which developers break up a system into cohesive and loosely coupled components.
Modularization
90
The degree to which a software system can be kept correct, reliable, and secure as it operating environment changes
Maintainability
91
The degree to which the functionality of a system can be changed or expanded
Extensibility
92
The degree to which a component, library of components, or framework can be leveraged in other software systems
Reuse
93
This practice is one way to achieve Localization of Design Decisions
Encapsulate What Varies
94
This practice can help understand the problem and problem domain better, as well as help formulate a solution, create a plan for developing the solution, and communicate with all stake holders
Conceptual Modeling
95
This practice can help developers modularize software into loosing coupled layers of abstractions
Organize Software into Loosely Coupled Layers, Conceptual Modeling
96
Both aggregation and inheritance can be used to achieve reuse. This practice recommends one over the over, when other considerations don't dictate one.
Prefer Aggregation Over Inheritance
97
This practice can help developers reduce coupling by using interfaces and abstraction effectively
Program to an Interface or Abstraction
98
The practice helps developers avoid the Uncommunitive Identifiers pitfall
Use Identifiers that Improve Readability and Maintainability
99
This practice is critical to any software development effort and can help all stakeholders gain confidence in correctness of the software
Testing with Executable Unit Test Cases
100
Exists in a software, where design or implementation uses identifiers that don't accurately communicate what the component represent
Uncommunitive Names
101
Exists when the identifiers in the design or implementation do not follow any logical naming method or standard set of terminology
Inconsistent Names
102
This pitfall exists when there are identifiers like "firstNameString" or "ageLabel" where String and Label are data types.
Types Embedded in Names
103
Lack of cohesion in a method is a likely consequence of this pitfall
Long Methods
104
Developers can slip into this pitfall if they don't localize design decisions
Duplicate Code
105
Inappropriate use of the decorator pattern may lead to this pitfall
Long Message Chains
106
The decorate pattern an help avoid this pitfall
Class Explosion
107
This pitfall exists when a class tries to do too much
Large Classes
108
Applying the decorator, strategy, template method or state pattern can often help extrication from this pitfall by reducing complex switch statement or if-then-else statement
Conditional Complexity
109
This pitfall may exist when there is similar block of code, but the blocks are not exactly the same
Oddball Solution
110
This pitfall reduces the readability and maintainability of the code, but does not have a direct impact on the functionality or performance
Redundant or Meaningless Comments, Dead Code
111
This pitfall exists where there is an unused variable or a statement that is never executed
Dead Code
112
When developers over design or implement feature that are not needed, they are succumbing to this pitfall.
Speculative Generality
113
This pitfall exists when a field (data member) is only set and used in a specific situation or context.
Temporary Field
114
This pitfall exists when a derived class is really not a specialization (subset) of a base class
Refused Bequest
115
This pitfall exists when certain bad forms of coupling are present, namely when one class uses the internal fields or methods of another
Inappropriate Intimacy
116
This pitfall exists when most of the logic of a method uses methods of another class.
Feature Envy
117
Ensure the system is in a known state, or at least the component you are testing is in a known state, e.g. create a triangle object with specific sides
Setup
118
Execute the thing you are testing, e.g., the ComputeArea() method
Simulate
119
Compare actual the results with the expected results. The results may be the return value of a method, or more generally, the system’s new state
Observe