chapter 6 Flashcards

(58 cards)

1
Q

What is design methodology?

A

logical and systematic steps to progress the design process.

also a set of guidelines for decision making.

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

What is refactoring (design methodology)?

A

Design decisions are revisited and revised.

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

What are design principles? Name the 6 principles.

A

Characteristics of good design.
Guidelines for decomposing a system.

  1. Modularity
  2. Interfaces
  3. Information hiding (public, protected, private)
  4. Incremental development
  5. Abstraction
  6. Generality
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is modularity in design principles?

A

A well organized system. Unrelated aspects are kept separate.

Each component has a single purpose.

Use coupling and cohesion to accomplish modularity.

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

What is coupling in design principles?

A

Degree by which software components are dependent on each other. Low coupling is better.

Tightly coupled: depend greatly on each other.
Loosely coupled: some dependencies.
Uncoupled: no dependencies.

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

What is content coupling?

A

Tightly coupled. A module that modifies the internal elements of another module. (internal access not public or protected methods).

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

What is common coupling?

A

Data is duplicated and kept in different modules. A change to the data needs to be changed in all duplicated locations.

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

What is control coupling?

A

When a module passes parameters or return code to control another module.

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

What is data coupling?

A

Data coupling is where modules are connected by unstructured data.

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

What is stamp coupling?

A

When two modules are connected by structured data (JSON format, csv, etc).

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

What is cohesion? What are the 7 types of cohesion?

A

Degree to which the elements inside a module belong together. High cohesion is better (think MVC).

  1. coincidental
  2. logical
  3. temporal
  4. procedural
  5. communicational
  6. functional
  7. informational
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is coincidental cohesion?

A

A module containing unrelated elements; low cohesion.

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

What is logical cohesion?

A

Parts are related only by the logic structure not functionally; low cohesion.

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

What is temporal cohesion?

A

Elements of a component are related by timing.

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

What is procedural cohesion?

A

Ensures the order of the execution; algorithms.

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

What is communication cohesion?

A

Multiple modules operates on the same data set (input or output). Place each dataset in its own module.

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

What is functional cohesion?

A

All elements essential to a function are contained in one module, and all of the elements are essential to the performance of the function.

The ideal solution.

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

What is informational cohesion?

A

Adaptation of functional cohesion to data-abstraction and object-based design.

Parts of a module are grouped together as they are suppose to operate on the same data or information.

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

What is an interface (design principle)?

A

defines the services of a system,
defines how units access the services; public methods.

A module can have several interfaces.

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

What is the specification of a software unit’s interface?

A

A description of the externally visible properties of a software system.

  1. purpose: description of the function.
  2. preconditions: requirements of the function (variables, libraries, etc.).
  3. protocols: sequence of function calls.
  4. postconditions: return values, exceptions, modified variables.
  5. quality attributes: no description given…
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What is information hiding?

A

Public, private, protected; only necessary information is shown. Good use of information hiding allows units to be loosely coupled.

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

What is incremental development?

A

Software is developed in phases.

Dependencies are used to design a development schedule for scrum.

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

What do “uses graphs” help a system do?

A

Helps to identify progressively larger subsets of our system that can be implemented and tested incrementally.

Fan-in: number of higher level modules that call this module.
Fan-out: number of lower level modules that this module uses.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What is sandwiching in incremental development?

A

A technique to break cycles in the “use graph,” It involves decomposing one unit so that the cycle ends.

25
What is abstraction (design principle)?
A general model that omits details. | Super class, sub class.
26
What is generality (design principle)? How is it done?
Making software as universally applicable as possible to increase the chance it will be useful in some future system. Done by: 1. Parameterizing context-specific info. 2. Removing preconditions. 3. Simplifying postconditions.
27
What is OO design?
A decomposition of a system into runtime components called objects that encapsulate data and functionality. 1. objects are uniquely "identifiable" runtime entities. 2. objects can be "composed"; object's variables can be objects themselves. 3. OO code can be polymorphic, generic code that works with objects of related types.
28
What is a class (OO design)?
Software module that partially or fully implements an abstract data type. It is essentially a custom data type.
29
What is an abstract class (OO design)?
A class with missing implementations for some of its methods.
30
What is a constructor (OO design)?
A function that runs when a new instance of an object is created.
31
What is an instance of a class (OO design)?
A specific example of a class.
32
What are attributes in a class (OO design)?
object's data attributes.
33
What are methods in a class (OO design)?
object's functions.
34
What is dynamic binding (OO design)?
Method overloading. The compiler cannot determine the binding at compile time. When the program runs then the binding is determined.
35
What is multiplicity (OO design)?
Used in diagrams. Represents the relationship between objects. (1 to many).
36
What is object composition (OO design)?
New classes built by combining component classes.
37
What is inheritance (OO design)?
Creating a new class by extending an existing one.
38
What is polymorphism (OO design)?
Code that interacts with an interface. | The actual bindings are figured out during run-time.
39
What are the two techniques for constructing large objects (OO design)?
inheritance: subclass's implementation is determined at design time. composition: better to preserve encapsulation and code reuse.
40
What is the Law of Demeter (OO design)?
Communicate to immediate closest friends. A -> B -> C If A wanted to execute a method in C, it should tell B to do it.
41
What is dependency inversion principle (OO design)?
High level code must not depend on low level code. Store -> Payment Class -> Paypal API, Visa API Store just needs to run a pay event. It doesn't need to know how to do it.
42
Define the types of relationships in an ER-diagram. (6 types)
association: relationship. A married to B. (straight line) composition: cannot exist on its own. a person has a heart. (closed diamond) aggregation: can exist on its own. a company has employees. (open diamond) generalization (inheritance): sub class -> super class (open triangle) dependency: one module depends on another (dashed arrow) navigation: can access another without them knowing? (solid arrow)
43
What is class description template?
A template that looks like python code.
44
What is a package diagram?
Shows the system as a collection of packages and their dependencies. Each package can contain many classes. Useful for testing.
45
What is a sequence diagram?
A diagram that shows a sequence of activities or behaviors.
46
What is a communication diagram?
A sequence of messages between objects.
47
What is a state diagram?
The possible states an object can take and the events that trigger transitions.
48
What is an activity diagram?
Flow of procedures or activities in a class.
49
Define OO design patterns?
A template of a solution based on design principles. It is not a library, rather a concept. MVC.
50
What is template model pattern (design patterns)?
``` The use of inheritance to create sub-classes. The abstract class implements common steps. The sub-classes implement specific steps. ```
51
What is the factory method pattern?
Encapsulates code that creates objects. Useful for creating a class at run-time (subclass type cannot be determined at compile time). EnemyShip -> UFO or ROCKET.
52
What is the strategy pattern?
Allows algorithms to be selected at runtime. Animals (super class), Dog + Bird (sub classes). Algorithm = fly();
53
What is the decorator pattern?
Extends an object's functionality at runtime. Adding more toppings to a pizza at runtime.
54
What is the observer pattern?
Application of the publish-subscribe architecture.
55
What is the composite pattern?
Promotes the use of a single uniform interface.
56
What are some tips for designing user interfaces? (6 things)
1. identify the audience 2. what ways can a system perform a task? 3. hierarchy of user commands 4. refine the sequence of user interaction w/ system 5. designing relevant classes for the UI 6. integrating ui into the overall system.
57
What is a framework?
A large reusable design for a specific application domain. | GUI editors, web applications, accounting systems.
58
What is a uses relation?
a dependency relation of each software unit.