Software Design Flashcards

1
Q

What are the GRASP principles and patterns?

A

The GRASP principles and patterns are
High cohesion and low coupling
Controller
Creator

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

What is dependency injection?

A

Dependency injection is a technique whereby one object (or static method) supplies the dependencies of another object. A dependency is an object that can be used (a service)

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

What is the common problem that RTTI and dependency inversion attempt to address?

A

RTTI and dependency inversion define methods that characterize common functionality of related objects

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

What specific maintainability-related concern do the Laws of Demeter attempt to address?

A

The Laws of Demeter addresses the concern of avoiding designs that reach “through” one object to another. It does so by limiting the use of inherited and reeferenced content from and classes.

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

How do the strong and weak laws of Demeter differ?

A

Strong Demeter limits the use of inherited content. Weak Demeter allows inheritance of any superclass attributes

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

What is variation inheritance?

A

Variation inheritance is describing a class in terms of difference with another class. It can be useful for defining a package in terms of an existing version

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

What is the relationship between tiered computing and the client-server architectural style?

A

Tiered computing is a multi-layered client server, where an immediate layer preprocesses clients request and or post process the server response

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

What do the broker and proxy architectural styles have in common and how do they differ?

A

Broker and Proxy are both forms of tiered computing.

  • A broker(host) intercepts an initial request then puts a client in direct contact with a server.
  • In a proxy, the proxy handles ALL communication between the client and server
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

In what ways are the deployment strategies for MVC and MVP the same? How do they differ?

A

Model View Controller and Model View Presenter are both forms of tiered computing. In MVC, the immediate layer(controller) resides on the server and handles all communication between views and models.

On the other hand, a presenter is used instead of a controller which resided on the client side.

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

What does it mean for a request to be idempotent?

A

Simply put, an operation is idempotent if it produces the same result when called over and over. An identical request should return an identical result when done twice, two thousand, or two million times

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

What is RPC?

A

RPC stands for Remote Procedural Call. RPC makes a programs modules easy to deploy in a network by making location of a server completely transparent.

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

What is REST?

A

REST stands for Represental state transfer. REST decouples UI and datasource which allows for cross-platform.

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

What is a key difference between REST and RPC?

A

RPC directs request to procedures / API’s while REST directs request to resources.

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

What is a key difference between REST and RPC?

A

RPC directs request to procedures / API’s while REST directs request to resources.

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

What purpose(s) does an ORM serve in client-server implementation?

A

An object relational mapper is used to interchange data between code or underlying database.

ORC handles two issues:

1) Creation and realization of schema
2) Creating logic for interchanging data between class and database

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

What is meant by the term “marshalling” in context of RPC?

A

Marshalling is the packing of procedure parameters into a message packet.

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

What is PUT?

A

PUT creates a new resource

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

What is POST?

A

POST updates an existing resource

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

What is data-first development?

A

Data-first development affords more control over detail and performance at a cost of additional coding and more expertise. You would want to use data-first when you are expecting a long lifetime of a database.

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

What is code-first development?

A

Code-first offers the opposite set of advantages and disadvantages of data first. You would use code first if the database has a short expected life.

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

Name the six types of cohesion in the Constantine hierarchy

A

Furry Soft Cats Prefer Tender Love Care

Functional 
Sequential 
Communicative 
Procedural 
Tempural 
Logical
Coincidental
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Describe Coupling

A
Data
Stamp
Control 
External 
Common
Global
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

What is Hybrid Coupling?

A

A subset of data used as control

Example: account numbers 00001 to 99999

If 90000 - 90999, send mail to area code of last 3 digit (000 - 999)

24
Q

Define the principles of common use and common closure as they pertain to components?

A

The Common Closure Principle (CCP) states: ”The classes in a component should be closed together against the same kind of changes. A change that affects a component affects all the classes in that component and no other components.”

25
Q

How can content coupling occur?

A

Content coupling can occur if a function in one module can control a function in another such as modifying.

26
Q

What is the principle of single choice?

A

Whenever a software system must support a set of alternatives, one and only one module in the system should know their exhaustive list.

27
Q

What is the DRY principle?

A

Don’t repeat yourself (DRY). You should only need to specify intent in one place. For example, in terms of application design, specific functionality should be implemented in only one component; the functionality should not be duplicated in any other component

28
Q

What is the separation of concerns?

A

Divide the application into distinct features with as little overlap in functionality as possible. The important factor is minimization of interaction points to achieve high cohesion and low coupling. However, separating functionality at the wrong boundaries can result in high coupling and complexity between features even though the contained functionality within a feature does not significantly overlap

29
Q

What is the single responsibility principle?

A

Each component or module should be responsible for only a specific feature or functionality, or aggregation of cohesive functionality

30
Q

What is abstraction?

A

Layered architecture abstracts the view of the system as whole while providing enough detail to understand the roles and responsibilities of individual layers and the relationship between them

31
Q

What is encapsulation?

A

No assumptions need to be made about data types, methods and properties, or implementation during design, as these features are not exposed at layer boundaries.

32
Q

What is cohesion?

A

Cohesion is the degree to which the elements of a program unit belong together. High cohesion is desirable since it promotes encapsulation.

33
Q

What are the 7 Structural Design Patterns?

A

The seven structural design patterns are:

adapter
bridge
composite
decorator 
facade
flyweight
proxy
34
Q

What is the Adapter pattern?

A

The adapter pattern allows objects with incompatible interfaces to collaborate

35
Q

What are structural design patterns?

A

Structural patterns explain how to assemble objects and classes into larger structures while keeping these structures flexible and efficient.

36
Q

What is the bridge pattern?

A

The bridge pattern lets you split a large class or a set of closely related classes into two separate hierarchies -abstraction and implementation - which can be developed independently of each other.

37
Q

What is the composite pattern?

A

The composite pattern lets you compose objects into tree structures and then work with these structures as if they were individual object

38
Q

What is the decorator pattern?

A

The decorator pattern lets you attach new behaviors to objects inside special wrapper objects that contain the behaviors

39
Q

What is a facade?

A

A facade provides a simplified interface to a library, a framework, or any other complex set of classes

40
Q

What is a flyweight?

A

A flyweight lets you 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 object.

41
Q

What is a proxy?

A

A proxy lets you provide a substitute or placeholder for another object. A proxy controls access to the original object, allowing you to perform something either before or after the request gets through to the original object.

42
Q

What are creational design patterns?

A

Creational Design Patterns provide various object creation mechanisms, which increase flexibility and reuse of existing code

43
Q

What is the factory method?

A

The factory method provides an interface for creating objects in a superclass to alter the type of objects that will be create

44
Q

What is an abstract factory?

A

An abstract factory lets you produce families of related objects without specifying their concrete classes

45
Q

What is the builder pattern?

A

The builder pattern lets you construct complex objects step by step. This allows you to produce different types and representations of an object using the same construction code.

46
Q

What is the prototype pattern?

A

The prototype pattern lets you copy existing objects without making your code dependent on their classes

47
Q

What is the singleton pattern?

A

The singleton pattern ensures that class has only one instance, while providing a global access point to this instance

48
Q

What are behavioral design patterns?

A

Behavioral Design patterns are concerned with algorithms and the assignment of responsibilities between objects

49
Q

Describe the chain of responsibility

A

The chain of responsibility lets you pass request along a chain of handlers. Upon receiving a request, each handler decides either to process the request or to pass it to the next handler in the chain.

50
Q

Describe the command pattern

A

The command pattern turns a request into a stand-alone object that contains all Information about the request. This transformation lets you parameterize methods with different request, delay or queue a request execution, and support undoable operations

51
Q

What is the iterator pattern?

A

The iterator pattern lets you traverse elements of a collection without exposing its underlying representation which may be a list, stack, tree, etc.

52
Q

Describe the mediator pattern

A

The mediator pattern lets you reduce chaotic dependencies between objects.
It restricts direct communications between the objects and forces them to collaborate only via a mediator object

53
Q

Describe the memento pattern

A

The memento pattern lets you save and restore the previous state of an object without revealing the details of its implementation

54
Q

Describe the observer pattern

A

The observer pattern lets you define a subscription mechanism to notify multiple objects about any events that happen to the objects they are observing

55
Q

Describe the state pattern

A

The state pattern lets an object alter its behavior when its internal state changes.

It appears as if the object changed its class

56
Q

Describe the template method

A

The template method defines the skeleton of an algorithm in the superclass but lets subclasses override specific steps of the algorithm without changing its structure.

57
Q

What is the visitor pattern?

A

The visitor pattern lets you separate algorithms from the objects on which they operate