2/20 - Software Architecture Flashcards

1
Q

Model View Controller (MVC) Architecture

A
  • A method for separating the user interface of an application from its domain logic.
  • UI and domain logic have different drivers for change and rates of change.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

The Model

A
  1. The model is the functional core of the application
  2. Encapsulates the state of the application
  3. Model is independent of the GUI
  4. Active Model
  5. Passive Model
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Functional core of the application

A
  1. Business logic

2. Domain logic

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

Business logic

A

business layer in enterprise applications

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

Domain logic

A

domain-specific logic

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

The State of the application

A
  • Example: databases
  • Invariants (e.g. a transaction in a zero-sum operation)
  • If model is correct the data will continue to make sense
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Model is independent of the GUI

A
  • It cannot direct references to the view or controller
  • This gives it flexibility, testability and robustness
    • Model can be tested using automated controller and machine checkable views
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Active Model

A
  • Defines a change notification mechanism that view and controller can subscribe to
  • Common in desktop GUI apps
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Passive Model

A
  • Model is called by view and controller to get data

* Common in web UI

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

The View

A
  • What data to show and how to present it based on the state of the model
  • View informs the controller of user actions
  • View has access to the model but should not change the model
  • For web apps, view contains HTML + Javascript
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

The Controller

A
  • View deals with output, Controller deals with input
  • Controller decides what model actions are needed, selects the next view and allows user to drive the app
  • In web apps, controller will be handler for incoming HTTP requests
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Pros of MVC

A
  • Allows to separate and modularize concerns. Leads to ease of development, testing and maintenance
  • Separation between data layer and interface is the key
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Why is separation between data layer and interface key?

A
  • View is easily replaced or expanded
  • Model data changes are reflected in views
  • Better scalability
  • Distribution over network is greatly simplified
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Cons of MVC

A
  • View and Controller depend heavily on model API
  • Close coupling between view and controller
  • Additional complexity
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Architectural Configurations

A

Arrangements of components and connectors to form an architecture

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

Examples of Architectural Configurations

A

MVC, Pipe and Filter, Layered Systems, Event based Systems

17
Q

Example of Pipe and Filter Architecture

A

Unix Shell commands

18
Q

Components of Pipe and Filter Architecture

A

filter transform input into output

19
Q

Connectors of Pipe and Filter Architecture

A

data stream

20
Q

Other examples of Pipe and Filter Architecture

A

compilers, batch data processing

21
Q

Pros of Pipe and Filter Architecture

A
  • Overall behavior is understood as a simple composition of the behaviors of the individual filters
  • Support reuse. Existing filters can be hooked up to form a system
  • Modular testing
  • Easy maintenance and enhancement
  • Supports specialized analysis (throughput or deadlock analysis)
  • Supports parallel or distributed execution
22
Q

Cons of Pipe and Filter Architecture

A
  • Not good for handling interactive apps
  • Sometimes we need tighter coupling of filter for better performance
  • Extra overhead to parse and unparsed data to an external format
23
Q

Example of a special case of pipe -filter

A

Map-Reduce

24
Q

Layered Architecture

A

Each layer provides a higher level of abstraction to the layer above

25
Q

Examples of Layered Architecture

A

Operating systems, ISO Network Protocol

26
Q

Interesting properties of Layered Architecture

A
  1. Support increasing levels of abstraction during design
  2. Reuse
  3. Support Enhancement (add functionality)
27
Q

Reuse (interesting property of Layered Architecture)

A

Can define standard layer interfaces and interchange implementations of same interface.

28
Q

Support Enhancement (interesting property of Layered Architecture)

A

Change in one layer affects at most two layers.

29
Q

Cons of Layered Architecture

A
  • May not be able to identify layers

* One layer may not want to communicate with a non-adjacent layer for performance reasons

30
Q

Event-Based Architecture

A

Independent reactive objects or processes

31
Q

Components of Event-Based Architecture

A

objects that register interest in “events” and objects that signal events

32
Q

Connectors of Event-Based Architecture

A
  • Explicit method invocation to register event listener
  • Implicit listener invocation when event fires
  • Control: decentralized, de-coupling of sender and receiver