Application Development Flashcards

1
Q

there are three (3) important characteristics of a bad design architecture that should be avoided:

A

Rigidity, Fragility, Immobility

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

The software is hard to change because every applied change will affect many parts of the software.

A

Rigidity

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

When applying changes, unexpected parts of the software breaks..

A

Fragility

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

The modules of the software are hard to reuse ins another software because these cannot be extracted from
the current software

A

Immobility

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

s are a set of guidelines
to be followed that helps developers arrange methods and data structures into classes,

A

Design principles

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

Martin assembled a set of five (5) software design principles, and Michael Feathers arranged these principles into an acronym
called SOLID.

A

(SRP), (OCP) , (LSP) , (ISP) , (DIP)

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

S-O-L-I-D

A

(SRP), (OCP) , (LSP) , (ISP) , (DIP)

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

This is one of the basic principles most developers apply to build robust and
maintainable software.

A

S: Single Responsibility Principle (SRP)

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

This suggests that each software module, class, or interface should have only one (1) reason to
change.

A

S: Single Responsibility Principle (SRP)

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

This states that for a software to be easy to change,

A

O: Open-Closed Principle (OCP)

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

the software classes must be designed to allow the behavior of those classes to be changed by adding new code rather than changing existing code.

A

O: Open-Closed Principle (OCP)

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

Barbara Liskov introduced this principle which states that the derived classes should be substitutable for their base classes to build a software from interchangeable modules or classes.

A

L: Liskov Substitution Principle (LSP)

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

This principle advises software designers to avoid depending on things that they don’t use.

A

I: Interface Segregation Principle (ISP)

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

This principle suggests that flexible software are those with classes that depend on abstract classes or interfaces.

A

D: Dependency Inversion Principle (DIP)

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

The blank instructs developers to design each module, interface, or class of a software system to
have only one (1) responsibility.

A

Single Responsibility Principle (SRP)

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

The accounting personnel is responsible
for computing the salary of an employee.
It should use the calculatePay()
method

A

Single Responsibility Principle (SRP)

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

The human resource personnel is
responsible for creating a report of hours
of an employee. It should use the
reportHours() method.

A

Single Responsibility Principle (SRP)

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

The database administrator is
responsible for saving an employee’s
details. It should use the
saveEmployee() method.

A

Single Responsibility Principle (SRP)

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

The blank states that software modules, interfaces, or classes should be open for extension but closed
for modification.

A

Open-Closed Principle (OCP)

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

For every newly added method, the unit testing of the software should
be done again.

A

Open-Closed Principle (OCP)

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

When a new requirement is added, the maintenance and adding
function may take time.

A

Open-Closed Principle (OCP)

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

Adding a new requirement might affect the other functionality of
software even if the new requirement works.

A

Open-Closed Principle (OCP)

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

To blank , use an interface,
an abstract class, or abstract methods to
extend the functionality of the class

A

Implement the OCP

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

The blank suggests that when creating a new derived class of an existing class, make sure that the
derived class can be a substitute for its base class.

A

Liskov Substitution Principle (LSP)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
The blank should be extended to the level of architecture. A simple violation of substitution can cause a system’s architecture to break.
LSP
26
The blank suggests avoiding depending on things that are not used.
Interface Segregation Principle (ISP)
27
This means that clients should not be forced to implement interfaces they don’t use. I
Interface Segregation Principle (ISP)
28
The blank suggests that the most flexible software systems are those in which source code dependencies refer only to abstractions, not to concretions.
Dependency Inversion Principle (DIP)
29
software engineer, blank are the reusable solutions to commonly occurring problems in software design.
design patterns
30
Design patterns are said to have four (4) essential features:
Pattern Name, Problem, Solution, Consequences
31
This is the name of a pattern that can be used to describe a design problem, its solution, and consequences.
Pattern Name
32
This describes when to use the pattern. It explains the problem and its context.
Problem
33
This describes the elements that make up the design, their relationships, responsibilities, and collaborations. The pattern provides an abstract description of a design problem and how a general arrangement of element solves it.
Solution
34
These are the results and interchanges of applying the pattern to the problem. They include time and space tradeoffs, but also flexibility, extensibility, and portability, among others.
Consequences
35
3 Categories of Patterns
Creational Patterns, Structural Patterns, Behavioral Patterns
36
These patterns deal with when and how objects are created. These provide object creation mechanisms that increase flexibility and reuse of existing codes.
Creational Patterns
37
These describe how objects are composed into larger groups and explain how to assemble objects and classes into larger structures while keeping their structures flexible and efficient.
Structural Patterns
38
These describe how responsibilities are distributed between objects in the design and how communication happens between objects.
Behavioral Patterns
39
are all about class instantiation. These are patterns that deal with object creation mechanisms, trying to create objects in a manner suitable to a certain situation.
Creational design patterns
40
This design pattern lets developers ensure that a class has only one (1) instance while providing a global access point to the instance.
Singleton Pattern
41
Ensure that a class has just a single instance. This is to control access to some shared resource—for example, a database or a file.
Singleton Pattern
42
. Make the default constructor private to prevent other objects from using the new operator with a Singleton class
Singleton Pattern
43
the Singleton class declares the static method getInstance() that returns the same instance of its own class.
Singleton Pattern
44
This provides an interface for creating objects in a superclass but allows subclasses to alter the type of object that will be created.
Factory Method Pattern
45
A developer is creating a logistics management application.
Factory Method Pattern
46
The Factory Method pattern suggests that he replace direct object construction using the new operator with calls to a special factory method.
Factory Method Pattern
47
Product declares the interface, which is common to all objects that can be produced by the creator and its subclasses.
Factory Method Pattern
48
This creational design pattern lets a developer copy existing objects without making his code dependent on their classes
Prototype Pattern
49
When a developer wants to create an exact copy of an object, s/he has to create a new object of the same class.
Prototype Pattern
50
The Prototype pattern delegates the cloning process to the actual objects being cloned
Prototype Pattern
51
, the Prototype interface declares the cloning methods. In most cases, it is a single clone method.
Prototype Pattern
52
This allows developers to produce families of related objects without specifying their concrete classes.
Abstract Factory Pattern
53
A developer is creating a furniture shop simulator.
Abstract Factory Pattern
54
Explicitly declare interfaces for each distinct product of the product family.
Abstract Factory Pattern
55
the Abstract Products declare interfaces for a set of distinct but related products which make up a product family.
Abstract Factory Pattern
56
This creational design pattern allows developers to construct complex objects step by step. The pattern allows developers to produce different types and representations of an object using the same construction code.
Builder Pattern
57
When creating an object that requires complex step-by-step initialization of many fields and nested objects, the initialization of an object will usually contain lots of parameters or will scatter all over the client code.
Builder Pattern
58
The Builder design pattern suggests that developers must extract the object construction code out of its own class and move it to separate objects called builders.
Builder Pattern
59
the Builder interface declares product construction steps that are common to all types of builders. ConcreteBuilder classes provide different implementations of the construction steps.
Builder Pattern
60
deal with the arrangement and relationship between the classes in the software system.
Structural design patterns
61
This structural design pattern allows objects with incompatible interfaces to collaborate. This pattern converts the interface of a class into another interface as expected by the client application
Adapter Pattern
62
For example, a developer developed a stock monitoring software for a certain client.
Adapter Pattern
63
In the Adapter pattern, a developer can create a special object called adapter that converts the interface of one (1) object so that another object can understand it
Adapter Pattern
64
the Client class contains the existing business logic of the program.
Adapter Pattern
65
This allows the developers to split a large class or a set of closely related classes into two (2) separate hierarchies, which are abstraction and implementation, that can be developed independently of each other
Bridge Pattern
66
For example, a developer created a Shape class with a pair of subclasses: Circle and Square.
Bridge Pattern
67
The given problem occurs because the developer is trying to extend the shape classes in two (2) different dimensions: by form and by color.
Bridge Pattern
68
the Abstraction provides high-level control logic. It relies on the implementation object to do the actual low-level task.
Bridge Pattern
69
Composite Pattern – This design pattern allows developers to compose objects into tree structures and then work with these structures treating them as individual objects
Composite Pattern
70
A developer created two (2) types of objects named Products and Boxes.
Composite Pattern
71
The Composite pattern suggests that a developer must work with Products and Boxes through a common interface which declares a method for calculating the total price.
Composite Pattern
72
the Component interface describes operations that are common to both simple and complex elements of the tree.
Composite Pattern
73
This allows developers to attach new behaviors to objects by placing these objects inside special wrapper objects that contain the behaviors
Decorator Pattern
74
A developer is working on a notification library that lets other programs notify their users about important events.
Decorator Pattern
75
The Decorator pattern suggests creating a wrapper object that can be linked with some target object.
Decorator Pattern
76
the Component declares the common interface for both wrappers and wrapped objects.
Decorator Pattern
77
This provides a simplified interface to a library, a framework, or any other complex set of classes
Facade Pattern
78
A developer is creating a code that works with a broad set of objects that belong to a sophisticated library or framework.
Facade Pattern
79
A facade is a class that provides a simple interface to a complex subsystem which contains lots of moving parts.
Facade Pattern
80
the provides convenient access to a particular part of the subsystem’s functionality. It knows where to direct the client’s request and how to operate all the moving parts.
Facade Pattern
81
This allows developers to fit more objects into the available amount of RAM by sharing common parts of state between multiple objects instead of keeping all of the data in each other
Flyweight Pattern
82
A developer creates a video game with realistic particle system of multiple bullets, missiles, and explosions
Flyweight Pattern
83
The Flyweight pattern suggests creating an object that is divided into two (2) parts: the state-dependent part and the stateindependent part.
Flyweight Pattern
84
the pattern is merely an optimization. Before applying it, make sure that a program does have the RAM consumption problem related to having a massive number of similar objects in memory at the same time.
Flyweight Pattern
85
This design pattern allows developers to provide a substitute or placeholder for another object.
Proxy Pattern
86
controls access to the original object, allowing developers to perform something before or after the requests gets through to the original object
Proxy Pattern
87
Developers want to control access to an object. For example, a developer has a large object that consumes a tremendous amount of system resources
Proxy Pattern
88
The Proxy pattern suggests creating a new proxy class with the same interface as an original service object and updating the application
Proxy Pattern
89
the Service Interface declares the interface of the Service. The proxy must follow this interface to be able to disguise itself as a service object.
Proxy Pattern
90
are concerned with how classes and objects behave in a system software and how objects communicate with each other
Behavioral design patterns
91
This design pattern allows developers to traverse elements of a collection without exposing its underlying representation, such as list, stack, and tree.
Iterator Pattern
92
A developer is creating a system with a search feature.
Iterator Pattern
93
The main idea of the Iterator pattern is to extract the search behavior of a collection into a separate object called an iterator
Iterator Pattern
94
the Iterator interface declares the operations required for traversing a collection: fetching the next element, retrieving the current position, restarting iteration, etc.
Iterator Pattern
95
This design pattern allows developers to define a subscription mechanism to notify multiple objects about any events that happen to the object they are observing. This means that when an object changes state, all of its dependents are notified and updated automatically
Observer Pattern
96
A developer created two (2) types of objects named Customer and Store
Observer Pattern
97
The object that notifies other objects about the changes to its state is called publisher
Observer Pattern
98
the Publisher class issues events of interest to other objects.
Observer Pattern
99
This allows developers to define a family of algorithms, put each of them into a separate class, and make their objects interchangeable.
Strategy Pattern
100
A developer created a navigation application for travelers
Strategy Pattern
101
The Strategy pattern suggests defining the class that does a specific task in several different methods and extracts all of these algorithms into separate classes called strategies
Strategy Pattern
102
the Context class maintains a reference to one of the concrete strategies and communicates with this object only through the Strategy interface
Strategy Pattern
103
104
105