Chapter 13 - Patterns and Tactics Flashcards

1
Q

what is a pattern?

A

it establishes a relationship between a context, a problem, and a solution

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

What is a pattern context?

A

a recurring, common situation in the world that gives rise to a problem

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

what is a pattern problem

A

the issue that arises in the given context

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

what is the pattern solution?

A

a successful architectural resolution to the problem appropriately abstracted

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

4 aspects that describe a pattern

A
  • a set of elements
  • a set of interactions
  • a topological layout of components
  • a set of semantic constraints
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Layer Pattern: context

A

there is a need for a clear separation of concerns so that modules of a system may independently developed and maintained

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

Layer Pattern: problem

A

the SW needs to be segmented in a way such that modules can be evolved separately with little interaction among parts

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

Layer Pattern: solution overview

A

divide software into layers.Each layer contains a cohesive set of services. There is a unidirectional allowed-to-use relation among the layers

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

Layer Pattern: solution elements (1)

A

layer

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

Layer Pattern: solution relations (between elements)

A

allowed-to-use

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

Layer Pattern: solution constraints

A
  • each piece of SW only in 1 layer
  • must be at least 2 layers
  • allowed-to-use relation cannot be circular
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Layer Pattern: solution weaknesses

A
  • the addition of layers adds up-front cost and complexity

- additional layers have a performance penalty

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

Broker Pattern: context

A

many system are a collection of distributed services. How do several system like this connect to each other and exchange info

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

Broker Pattern: solution problem

A

how to structure distributed software so that users do not need to know the nature and location of service providers

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

Broker Pattern: solution overview

A

it defines a broker that mediates communication between a number of clients and servers (all communication from client to server goes through broker)

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

Broker Pattern: solution elements (5)

A

client - requester of services

server - provider

broker - intermediary

client-size proxy- an intermediary that manages the communication from the clients and forwards that info to broker

server-side proxy- same as above but for server

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

Broker Pattern: solution relations

A

the attachment relation associates clients and servers with brokers

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

Broker Pattern: solution constraints

A

client and server call only attach to the broker

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

Broker Pattern: solution weaknesses (5)

A
  • broker adds latency and can become a communication bottleneck
  • broke can be single point of failure
  • broker add up front complexity
  • broker can be target of security attacks
  • broker hard to test
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Model-View-Controller: context

A

the UI needs to change often. as the user looks at data it should reflect that data’s current state

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

Model-View-Controller: problem

A

how to make interface functionality separate from application functionality and yet still be responsive to user input and/or changes to the data

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

Model-View-Controller: solution overivew

A

breaks the system functionality down into 3 components: a model, a view, and a controller

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

Model-View-Controller: elements

A

model- represents the app data or state and contains app logic

view - UI component

controller - translates user actions into changes in the model or changes to the view

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

Model-View-Controller: relations

A

the notifies relation

connects instances of model, view, and controller notifying elements of relevant state changes

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

Model-View-Controller: constraints (2)

A

need at least one model, view, and controller

model should not interact directly with controller (no method calls or events to controller from model)

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

Model-View-Controller: weaknesses (2)

A
  • complexity not worth it for simple UI

- model, view, and controller abstractions may not be good for some UI toolkits

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

Pipe and Filter Pattern: context

A

many system need to repeatedly transform streams of discrete information.

Thus we want certain types of transformations to be reusable pieces

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

Pipe and Filter Pattern: problem

A

this kind of system needs to be divided into reusable loosely coupled components with simple, generic interaction mechanisms

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

Pipe and Filter Pattern: solution overview

A

the system is composed of pieces called filters that transform their inputs in some way and pass their outputs through a pipe to another component that uses those as inputs for some other transformation.

30
Q

Pipe and Filter Pattern: elements

A

filter- a component that transforms inputted data to produce some output

pipe- a connector that takes data from the output of one filter and passes it as input to another filter

31
Q

Pipe and Filter Pattern: relations

A

the attachment relation

associates the output of filters with input of pipes and vice versa

32
Q

Pipe and Filter Pattern: constraints (2)

A
  • pipes connect filter output ports to filter input ports

- connected filters must agree on the type of data being passed along the connecting pipe

33
Q

Client-Server Pattern: context

A

there are shared resources and large numbers of distributed clients wish to access and that we want to control access to

34
Q

Client-Server Pattern: problem

A

we want to improve scalability and availability by centralizing control of resources and services while they are distributed over many physical servers

35
Q

Client-Server Pattern: solution overview

A

clients initiate interactions with servers invoking services as needed from those servers and waiting for the results

36
Q

Client-Server Pattern: elements

A

client - a component that invokes services of a server component

server- a component that provides services to clients

request/reply connector- a data connector that is used by clients to invoke services on a server

37
Q

Client-Server Pattern: relations

A

that attachment relation

associates clients with servers

38
Q

Client-Server Pattern: constraint (2)

A
  • clients are connected to servers through request/reply connectors
  • server components can be clients to other servers
39
Q

Client-Server Pattern: weaknesses (3)

A
  • server can be a bottle neck
  • server can be single point of failure
  • decisions about where to locate functionality are complex and expensive to change later
40
Q

Peer-to-Peer pattern: context

A

several equally important computational entities with all their own stuff need to cooperate to provide a service to distributed users

41
Q

Peer-to-Peer pattern: problem

A

how are the equal computational entities to be connected via some common protocol so they can organize and share services

42
Q

Peer-to-Peer pattern: solution overview

A

computation is achieved by cooperating peers that request service from and provide services to one another across a network

43
Q

Peer-to-Peer pattern: elements

A

peer - an independent component running on a network node

request/reply connector- used to connect to the peer network, search for peers, and invoke services from peers

44
Q

Peer-to-Peer pattern: relations

A

attachment relations associates peers with their connectors

45
Q

Peer-to-Peer pattern: constraints (3)

A
  • the number of allowable attachments to any given peer
  • number of hops used for searching for a peer
  • which peers know about which other peers
46
Q

Peer-to-Peer pattern: weaknesses (2)

A
  • managing security, data consistency, availability, backup, and recovery all more complex
  • small system may not achieve performance and availability goals
47
Q

Shared-Data Pattern: context

A

computational components need to share and manipulate large amounts of data

48
Q

Shared-Data Pattern: problem

A

how to store data in away where multiple independent components can access it

49
Q

Shared-Data Pattern: solution overview

A

communication between data accessors is mediated by a shared data store

50
Q

Shared-Data Pattern: elements

A

shared-data store- concerns include types of data stored, performance properties, data distribution, and number of accesors permitted

data accesor component

data read/write connector

51
Q

Shared-Data Pattern: relations

A

attachment

determines which data accesors are connected to which data stores

52
Q

Shared-Data Pattern: constraints (1)

A

data accesors only interact with data stores

53
Q

Shared-Data Pattern: weaknesses (3)

A
  • shared data store can be a bottleneck
  • data store a single point of failure
  • producers and consumers may be tightly coupled
54
Q

Map-Reduce Pattern: context

A

business have a need to quickly analyze HUGE volumes of data

55
Q

Map-Reduce Pattern: problem

A

for HUGE data sets, organizing and analyzing the group data is sufficient. How do we efficiently do this and make it easy for the programmer

56
Q

Map-Reduce Pattern: solution overview

A

an infrastructure that takes care of allocating software to hardware nodes in a massive parallel computing environment

57
Q

Map-Reduce Pattern: elements

A

map: a programmer specified component that filters the data to retrieve those items to be combined
reduce: a programmer specified component that combines the results of the map
infrastructure: the framework for deploying the map and reduce instances and shepherding the data between them

58
Q

Map-Reduce Pattern: relations

A

-the deploys on relation

between an instance of a map or reduce function and the processor on which its installed

-instantiate, monitor, and control relation between the infrastructure and the instances of map and reduce

59
Q

Map-Reduce Pattern: constraints (3)

A
  • the data to be analyzed must exist as a set of files
  • map functions are stateless and don’t communicate
  • maps communicate to reduce through pairs
60
Q

Map-Reduce Pattern: weaknesses (3)

A
  • too much overhead for smaller data sets
  • data needs to be dividable for parallelism
  • multiple reduces make it complex
61
Q

Multi-Tier Pattern: context

A

often a need to distribute system’s infrastructure into distinct subsets

62
Q

Multi-Tier Pattern: problem

A

how to split the system into distinct groups of software and hardware connected by some communications media

63
Q

Multi-Tier Pattern: solution overview

A

the execution structures are organized into a set of logical groupings components called tiers

64
Q

Multi-Tier Pattern: elements

A

tier: logical grouping of components

65
Q

Multi-Tier Pattern: relations

A

is part of relation - groups components into tiers

communicates with relation- shows how components interact with each other

allocated to relation- shows how tiers are mapped to computing platforms

66
Q

Multi-Tier Pattern: constraints (1)

A

a software component belongs to one tier

67
Q

Multi-Tier Pattern: weaknesses (1)

A

substantial up-front cost and complexity

68
Q

Why do we rarely use patterns straight out of the box?

A

because they have weaknesses with respect to other qualities that are important to us

69
Q

what are tactic side effects

A

the undesirable effect of applying a tactic. its usually the worsening of some other quality attribute that’s inherent to the tactic

70
Q

If every tactic has a side-effect and then we apply another tactic to combat that side effect how do we avoid an endless process?

A

eventually the side effects of applying more tactics become small enough to ignore