chapter 6 Flashcards

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
Q

What is abstraction (design principle)?

A

A general model that omits details.

Super class, sub class.

26
Q

What is generality (design principle)? How is it done?

A

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
Q

What is OO design?

A

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
Q

What is a class (OO design)?

A

Software module that partially or fully implements an abstract data type.

It is essentially a custom data type.

29
Q

What is an abstract class (OO design)?

A

A class with missing implementations for some of its methods.

30
Q

What is a constructor (OO design)?

A

A function that runs when a new instance of an object is created.

31
Q

What is an instance of a class (OO design)?

A

A specific example of a class.

32
Q

What are attributes in a class (OO design)?

A

object’s data attributes.

33
Q

What are methods in a class (OO design)?

A

object’s functions.

34
Q

What is dynamic binding (OO design)?

A

Method overloading.
The compiler cannot determine the binding at compile time.

When the program runs then the binding is determined.

35
Q

What is multiplicity (OO design)?

A

Used in diagrams. Represents the relationship between objects. (1 to many).

36
Q

What is object composition (OO design)?

A

New classes built by combining component classes.

37
Q

What is inheritance (OO design)?

A

Creating a new class by extending an existing one.

38
Q

What is polymorphism (OO design)?

A

Code that interacts with an interface.

The actual bindings are figured out during run-time.

39
Q

What are the two techniques for constructing large objects (OO design)?

A

inheritance: subclass’s implementation is determined at design time.
composition: better to preserve encapsulation and code reuse.

40
Q

What is the Law of Demeter (OO design)?

A

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
Q

What is dependency inversion principle (OO design)?

A

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
Q

Define the types of relationships in an ER-diagram. (6 types)

A

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
Q

What is class description template?

A

A template that looks like python code.

44
Q

What is a package diagram?

A

Shows the system as a collection of packages and their dependencies.
Each package can contain many classes.
Useful for testing.

45
Q

What is a sequence diagram?

A

A diagram that shows a sequence of activities or behaviors.

46
Q

What is a communication diagram?

A

A sequence of messages between objects.

47
Q

What is a state diagram?

A

The possible states an object can take and the events that trigger transitions.

48
Q

What is an activity diagram?

A

Flow of procedures or activities in a class.

49
Q

Define OO design patterns?

A

A template of a solution based on design principles. It is not a library, rather a concept. MVC.

50
Q

What is template model pattern (design patterns)?

A
The use of inheritance to create sub-classes.
The abstract class implements common steps.
The sub-classes implement specific steps.
51
Q

What is the factory method pattern?

A

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
Q

What is the strategy pattern?

A

Allows algorithms to be selected at runtime.
Animals (super class), Dog + Bird (sub classes).
Algorithm = fly();

53
Q

What is the decorator pattern?

A

Extends an object’s functionality at runtime. Adding more toppings to a pizza at runtime.

54
Q

What is the observer pattern?

A

Application of the publish-subscribe architecture.

55
Q

What is the composite pattern?

A

Promotes the use of a single uniform interface.

56
Q

What are some tips for designing user interfaces? (6 things)

A
  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
Q

What is a framework?

A

A large reusable design for a specific application domain.

GUI editors, web applications, accounting systems.

58
Q

What is a uses relation?

A

a dependency relation of each software unit.