Softwre architecture Flashcards

1
Q

Software architecture

A

Fundamental organization of a system embodied in its components, their relationship to each other and the environment and the principles governing its design and evolution

How components of a system communicate, constraints that rule the whole system

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

What are the 3 main parts of software architecture

A

1)Architectural patterns
2)Messages + API
3) Quality attributes

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

Architectural views

A

Context view
Functional View
Information view
Concurency view
Development view
Deployment view
Operational View

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

what is context view?

A

System scope and responsabilities
Expternal services and responsabilities
External Interface-API Specifications

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

What is informational view

A

How system stores manipulate manages distributes info

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

What is Functional view

A

Breaking system into high-level components
Defining interfaces
Describing interactions between components

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

How to represent architecture Context view

A

C4- Context Diagram
Are component , interface dependency

Lollipop notation- main interface of each component– The sockets (-c) denote the interfaces the component
requires (input)
– The lollipops (-o) denote the interfaces a given component
provides (output)

Merge a component into its only client. If you have a
component that is a server to only one other component,
you may decide to combine the two components.

Highly coupled classes belong
in the same component.
* Minimize the size of the message
flow between components

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

UML Sequence diagram

A
  • Shows the sequence for a particular action in
    the system
  • (Semi-)Detailed description of a particular
    scenario
  • Highlights interactions between actors and the
    components of your system
  • Sequence Diagrams (at a high level of
    abstraction) can be used to support
    requirements engineering and high-level
    design
  • Sequence Diagrams (at a lower level of
    abstraction) can be useful for documentation
    purposes for developers

Be able to read and create sequence diagrams
– Lifeline, Destruction
– Synchronous message, Response message
– Combined fragments: Alt, Loop, Break
– We will not use other elements

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

Activity diagrams

A

UML Activity Diagram
* Show the activities involved in a process or
data processing
* In some cases better alternative to sequence
diagram
More useful for requirements elicitation and/or
implementation (tomorrow) than for designing
architecture
Be able to read activity diagrams
– Action, Edge, Object node
– Initial node, Activity Final node, Decision node, Merge
node, Parallelization node, Synchronization node
– We will not use other elements

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

Explain Client and Server Pattern

A

Server hosts, delivers and manages most
resources and services to be consumed by the
client. Multiple client computers connect to a
central server over a network (e.g. the internet).

The server does not know the
number or identities of clients
Clients know the server’s identity
Connectors are RPC-based
network interaction protocols
(RPC = Remote Procedure Call)

Client and Server are different processes with
well-defined interface
Client and Server have different roles
– Server provides the service; it has the business logic
– Client (usually) cannot be fully trusted

  • Advantages
    – Scalability: often easy to scale horizontally by
    deploying more servers (with load balancers)
    – Reusability: General functionality can be available to
    all clients and does not need to be implemented by
    all services
  • Disadvantages
    – Reliability: Each service is a single point of failure
    – Preformance: may be unpredictable (network
    influence)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Explain what Layered Architecture is

A

This pattern is used for systems that can be decomposed into groups of layers, each of which is at a particular level of abstraction.

Each layer
provides services to the next higher layer and consumes services from the lower layer (least knowledge principle).

Each component exposes an interface to be used by the layer above

Each component sees the layer below (in the hierarchy) as one single opaque layer
(virtual machine)

For example, Layer 2 provides an API for Layer 1 and it uses the API of the layer 2

Every module (e.g., class or package) must be allocated to one and only one layer.
The API to the adjacent (higher) layer can be implemented using the Facade or the Proxy design patterns.

Using a Proxy or a Facade depends on the context (do we need to simplify the interface?)
If one of the layer is a legacy system, we could also use the Adapter pattern to manage the APIs

Ex computer networks, operating system

  • Advantages
    – Testability: we can test each layer in isolation (using mocks and stubs)
    – Maintainability: a change in the behaviour of a layer has no effect on the layers below it
    – Flexibility: we can exchange one layer (e.g., transport layer) with any alternative layer as long as the new and old layers
    implement the same interface
  • Disadvantages
    – Higher complexity: additional abstraction increases the overall
    complexity
    – Lower performance: one request may pass through all layers in a chain of responsibility to be properly handled by the system
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is MVC

A

Model-View-Controller (MVC)
* MVC is basically a three-layered architecture
* Commonly used in web development

91
Model-View-Controller (MVC)
* Advantages
– Maintainability: you can make changes to one component without
affecting the others (e.g. data can change independent of
representation)
– Reusability: components can be easily reused (e.g. same view for
different models)
– Flexibility: different representations of the same data
– Testability: possible to test each layer separately (with mocks and
stubs)
* Disadvantages
– Complexity: Additional code and complexity, especially when model
and interactions are simple
– Maintainability: Often easy to “escape” from MVC and do things in
wrong layers (e.g. views triggering database queries directly)

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

What is pipe and filter pattern

A

The Pipe-Filter pattern provides a structure for systems that produce a stream of data. Each processing step is encapsulated in a filter component while data is passed through pipes
Pipe: A connector, which transports data from
one filter to the next, preserving the order

Filter: a components that reads data, transforms it, and return the transformed data

Filters must define expected input and produced output (proper API and documentation needed)
Pipes have a single input and output, and do not alter the data in transit
Some variants of this pattern also include the source (where the data comes from) and the sink (the component receiving the final data)
This pattern is often used for data intensive applications, buffering or for synchronisation

  • Advantages
    – Reusability: possible to build different pipelines by recombining
    a given set of filters
    – Extensibility: it is very easy to add a new filter
    – Testability: filters can be tested separately
    – Concurrency: input and output consist of streams; filters start
    computing when they receive data (async)
  • Disadvantages
    – Performance: large overhead due to data transformation (and
    depending on pipeline length)
    – Low responsiveness (latency): not useful for interactive
    applications
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is mocroservice arhitecture

A
  • Microservices re-arrange
    an application as a
    collections of loosely
    coupled services.
  • Each microservice can be
    implemented in different
    programming languages,
    database, hardware and
    software environment, etc
  • Services are small and easily
    maintained.
  • Services are independently
    deployable.
  • Services are independently
    scalable.
  • The microservice architecture
    enables teams to be
    autonomous.
  • Advantages
    – Modularity: application is divided into small microservices that are easy to maintain, test, understand, etc.
    – Scalability: since microservices are implemented and deployed
    independently of each other, they can be monitored and scaled independently
    – Integration: microservices can be integrated with legacy systems
    – Distributed development: different teams can develop different microservices
    independently from one another
  • Disadvantages
    – Network overhead: all communications between microservices happen in the
    network. Thus, there is higher network latency and message processing time than in-process calls within a monolithic architecture
    – Deployment is more complicated
    – Security: the more the data in the network the larger the attack surface
    – Moving responsibilities between services is more difficult
  • When to use it
    – Large and complex system
    – Need for scaling up and down
    – Working with multiple software development teams
    – Scale of > 500,000 users
    – Heterogeneous tech stack
  • When not to use it
    – Small or simple application
    – Intensive communication between services
    – Inadequate team size or no skills in distributed systems
    – Lack of experience with microservices
    – Early-stage projects or rapid prototyping
    – Data consistency requirements
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is Publish subscribe pattern

A

Publishers and subscribers are independent
and unaware of each other
* Multiple consumers subscribe to events
published by various producers

Publisher: any component that publishes an event. Specific events published should be
documented
Subscriber: any component that subscribes to an event
Event Bus: responsible for registering component subscriptions and delivering published events (e.g., network protocol

  • Publishers and subscribers don’t know of each
    others existence
  • Subscribers receive only a subset of published
    messages (the event bus filters)
  • Advantages
    – Reusability: services can be reused to make many applications
    – Testability: publishers and subscribers can be tested separately
    – Scalability: we can have as many publishers or subscribers as we
    want
    – Separation of concerns
    – Loose coupling: publishers and subscribers are loosely coupled, and
    don’t even need to know each other
  • Disadvantages
    – Scalability (bottleneck): all messages travel through same event bus
    – Security: all messages are sent through the same event bus
    – Availability: did the subscriber receive the requested data?
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is event driven architecture

A

The event-driven architecture (EDA) consists of event producers (or agents), event consumers (or sinks), and event channels

Events are the inputs to EDA. Events trigger transitions from one state to another one in our system
Producers have the responsibility to detect, gather, and transfer events.
Sinks (consumers) have the
responsibility of applying a reaction as soon as an event is presented
An event channel can be a TCP/IP connection, or any type of an input file (flat, XML format, e-mail, etc.)

EDAs can be implemented using existing frameworks (integration hubs), which already provide
the interfaces for events, brokers, and channels (and communication protocols).
So, you can focus on implementing your events and the business logic (the processors/consumers)
Some examples:
* Event mediator implementation: Spring Integration, Apache Camel, or Mule ESB
* Event flows can be implemented in Java or using a DSL (domain-specific language)
* In Apache ODE uses XML format to describes the data and steps required for processing an initial event

  • Advantages
    – Real-time: very useful for real-time systems (e.g. alarm management in the EWI building, satellites, etc.)
    – Loose coupling: the event itself doesn’t know about the
    consequences of its cause
  • Disadvantages
    – Increased complexity: we need to implement the events,
    the messages and the sinks (handlers)
    – Security: the event queue can become the main attack
    point (buffer overflow, DoS)
    – Reliability: potential loss of events/states