Teorias

T1

Software Engineering

Definition: Software Engineering

Systematic, disciplined, quantifiable approach to the analysis and design, implementation and exploitation of software systems.


T2

Requirements

Definition: Requirement

  1. expressions of users' necessities and restrictions that are placed on the system;
  2. for an engineer: something that needs to be conceived;
  3. a condition or a capacity that someone needs to solve a problem or to achieve an objective;
  4. a condition or a capacity that must be verified or possessed by a system or by a system component to satisfy a contract, standard, specification, or other formally imposed documents;
  5. a documented representation of a condition or capacity, as in (3.) or (4.)

The IEEE 610.12-1990 standard definition divides requirements into two alternatives:

  1. user needs (user requirements)
  2. system capacities (system requirements)

Requirements can be divided into:

  1. functional requirements
  2. non-functional requirements

Functional Requirements

Definition: Functional Requirements

A functional requirement describes a functionality to be made available to the users of the system.

Set of Requirements

Set of requirements

Collectively, the set of functional requirements must be complete (if it considers all the necessities that the client wishes to see satisfied) and coherent (if there are no contradictions among its elements).

Implicit and Explicit Requirements

Definition: Implicit Requirements

A requirement included by the development team, based on the domain knowledge that it possesses, in spite of not having been explicitly requested by the stakeholders.

Definition: Explicit Requirements

A requirement that was requested by the clients and that is represented in the documentation.

Non-Functional Requirements

Definition: Non-Functional Requirements

  1. a set of restrictions imposed on the system to be developed;
  2. requirements that establish how attractive, fast, or reliable the system is;
  3. includes time constraints, restrictions in the development process, or adoption of standards.

Also refered as quality requirement or quality attribute.

Classification of Requirements

Sommerville: Classification of Non-Functional Requirements

  1. product requirements: characterise aspects of the behaviour of the system itself (reliability, performance, efficiency, portability, usability, testability, and readability).
  2. organisational requirements: come from strategies and procedures established in the context of the manufacturing process of the system or the client organisation (process standards and implementation requirements).
  3. external requirements: have origin in external factors to the system and the development process (interoperability, legal, and ethical requirements).

Robertson and Robertson: Classification of Non-Functional Requirements

  1. appearance: the aspect and the aesthetics of the system;
  2. usability: the easiness of utilisation of the system and everything that permits a more friendly user experience;
  3. performance: aspects of speed, real-time, storage capacity, and execution correction;
  4. operational: characteristics about what the system must do to work correctly in the environment where it is inserted;
  5. maintenance and support: attributes that allow the system to be repaired or improved and new functionalities to be added;
  6. security: issues related to access, confidentiality, protection, and integrity of the data;
  7. cultural and political: factors related to the stakeholders culture and habits;
  8. legal: laws that apply to the system so that it can operate.

System Requirements

Definition: System Requirement

A more detailed specification of a requirement, being generally a formal model of the system. These requirements are oriented towards the solution domain, helping the engineers in the system design and construction.

Pasted image 20231229192852.png

Problem Domain

Note

  • The requirements result from necessities that exist in the problem domain to be addressed;
  • User requirements should be described with the problem domain terminology.

SUMMARY T2


T3

Requirements Engineering

Definition: Requirements Engineering

  1. All the activities related to requirements discovery, negotiation, documentation, and maintenance; Alternative designation: analysis.
  2. The study of a problem that leads to the system development, before taking any design or implementation action.
  3. Requirements engineering, in the scope of software engineering, is focused on the real-world objectives established for the functionalities and the restrictions of software systems.
  4. The process of discovery, analysis, documentation and checking the services and restrictions related to the operation and development of software systems;
  5. A set of structured activities that, with respect to a system, aid in obtaining an understanding about the domain, the restrictions of operation, the functionalities requested by the stakeholders and the essential characteristics.

Important

  1. Requirements engineering determines what the system must do to meet the necessities of users and not how it should be built.
  • It is desirable keeping the requirements strictly separated from their own solutions.

Important

The requirements of a given system are necessary, clear, correct, complete, viable, traceable, verifiable and negotiable.

Requirements Engineering Process

Pasted image 20231229194439.png

1. Inception

2. Elicitation

3. Elaboration

4. Negotiation

5. Documentation

6. Validation

7. Management

When to reject changes:

  1. there would be a significative increase in cost;
  2. there would be a postponement of the final delivery;
  3. there would a system devaluation for the user (system gets worse from a user stand-point).

Dimensions of Requirements Engineering

What is our objective? How to get there (make documents more vague or more formal...)?
Pasted image 20231229194702.png

Dificulties of Requirements Engineering

  1. Communication problems between requirements engineers and users are common.
    1. Professional Jargon - aka technical speak that nobody else (stakeholders) understands
  2. Clients unable to verbalise what they desire
    1. Solved by observing the users performing their functions in the real context
  3. Clients do not notice that they explained incorrectly the problem until they receive a solution that does not satisfactorily solve it
    1. Solved by making sure that, prior to starting the development, the problem to be handled is well formulated and corresponds to the reality (AKA communicate with the client and ask specific questions about what they need)
  4. The engineer thinks he knows more about the problem of the client than the client himself
    1. Solved by making sure the engineer feel the difficulties faced by the users in the real context (AKA put yourself in the shoes of the client)
  5. Frequent changes of requirements
    1. changes in the requirements must be considered as a natural fact and not as the result of an initial request poorly formulated
    2. Solved by finding adequate mechanisms that allow changes in the requirements to be incorporated, without major perturbations in the work previously developed and the development team being adequately prepared to cope with the various changes
  6. Requirements engineering is one of the most difficult activities to be executed in the scope of software engineering
    1. No technique used in isolation is sufficient to elicit the requirements of a system
    2. Requirements engineers must select the techniques that are appropriate to the complexity of the system and to the development context

SUMMARY T3

T3

Template for Requirements Documents

Generic Structure for the requirements documents

  1. Project Triggers
  1. purpose of the system
  2. client, customer, stakeholders
  3. users of the system
  1. Restrictions of the project
  1. mandatory restrictions
  2. taxonomy and definitions
  3. facts and assumptions
  1. Functional requirements
  1. scope of the work
  2. scope of the system
  3. functional and data requirements
  1. Non-functional requirements
  1. appearance
  2. usability
  3. performance
  4. operational
  5. maintenance
  6. security
  7. cultural and political
  8. legal
  1. Project issues
  1. open issues
  2. immediate solutions
  3. new problems
  4. tasks
  5. migration to the new system
  6. risks
  7. costs
  8. user manual
  9. waiting room
  10. ideas for solutions

Guidelines for writing requirements documents

Advantages/disadvantages of writing requirements in a natural language without any restriction

Advantages:

  1. there are no limits to expressiveness
  2. it is understandable by all literate persons
  3. it does not require any specific training.

Disadvantages:

  1. Free writing presents normally many ambiguities.
  2. The final quality varies from case to case.
Technical writing

  • The language must be simple, clear, and precise.
  • No figures of speech, like metaphors or similes
  • The words should be adopted in their denotative meanings, aka no space for possible alternative interpretations
  • Technical writing must be done in an impersonal, objective, clear, humble, and polite style.

Standardized format for user requirements

Standardized format

  1. a subject that indicates the type of users that benefit from that requirement;
  2. an intended result to achieve with the requirement (using a predicate):

-verb (i.e., functionality to be performed)
-other sentence elements to complete the predicate: (direct, indirect, prepositional) objects, predicatives, and adjuncts

  1. a mechanism to allow a test for the requirement to be defined

Example

user - The hotel receptionist
functionality - should visualise
object/concept - the room number of a guest
test - 2 seconds after making the request.

User Stories

Definition: User Story

A simple and short description of a functionality, made in the perspective of the person that needs it.

Format:

As a <\type of user>, I want to <\objective> for <\reason>.

Example:

As a hotel receptionist, I want to visualise the room number of a guest for calling him if someone wants to contact him.

Standardized format for system requirements

Standardized format

  1. A subject, either the system under development or a design entity that is related to the requirement.
  2. an intended result to achieve with the requirement (using a predicate):

-verb (i.e., functionality to bring about)
-other sentence elements to complete the predicate: (direct, indirect, prepositional) objects, predicatives, and adjuncts.

Example

system/entity - The signal of the battery
functionality - must turn on
description - when the charge is lower than 20 mA h

Standardized format for non-functional requirements

Standardized format

  1. the system under development or a design entity that is related to the
    requirement.
  2. a quality to be achieved with the requirement:

-verb (in some cases, a verbal form of “to be” or “to have”, or something equivalent);
-object (i.e., a description)

Example

  • The product shall be easy to use for illiterate persons
  • The product must continue to function at 30 metres under water.
  • The product must be prepared to be translated to any language.
  • The source code of the product programs should contain comments

How to write requirements

Possible problems with writing

Ambiguity

Definition: Ambiguity

Words, expressions, or sentences that express more than one possible understanding.
It should be avoided in requirements writing, since all technical documents must be clear.

SUMMARY T4


T5

Elicitation

Process of Elicitation

Pasted image 20231229231855.png

Stakeholders

Definition: System Stakeholder

Some person (meaning: person/group of people/organization) that has some type of legitimate interest (meaning: will be utilising, be affected by, or have some kind of responsibility in relation to) in that system, as they can be materially affected by the implementation of that system.

Roles

Note

  • The identification of the various stakeholders can be performed through the characterisation of the roles or positions that exist in the organisation.
  • Some persons can accumulate several roles
  • Example: the director of a company that is also responsible for financial accounting

Ways for identifying roles

Ways to indetify roles

  1. Ask the client;
  2. Examine the organisation chart;
  3. Compare with similar products;
  4. Analyse the system context;
  5. Consult the stakeholders that are commonly found in the majority of the systems

Users

Definition: User

Any person that operates and interacts directly with the system, whenever it is in effective operation in its environment.

Clients

Definition: Client

The entity that orders and pays for the development of a system.

Customers

Definition: Customers

Someone who pays for acquiring a system, whenever available.

  • These are the ultimate consumers, for whom the system is rendered.

Market Segment

Definition: Market Segment

The characterisation of the necessities and common behaviours of the customers to which is oriented a given product defines its market segment.

AKA necessities + common behaviours of customers -> create a market segment
Market segments are where products thrive (generate a product which solves the needs of customers and you will gain financially and make many happy customers)

Important

A group of customers represents a distinct market segment if:

  1. their necessities demand and justify a different offer;
  2. they are approached through different distribution channels;
  3. they need different types of relations;
  4. they have significantly distinct levels of profitability;
  5. they are willing to pay for different aspects of the offer.

Negative Stakeholders

Definition: Negative Stakeholders

Someone that desires that the system is not developed.

AKA competition, people with financial/political gain if the system is not developed...

General competencies of a requirements engineer

  1. Questioning: to ask questions about the requirements to the right persons;
  2. Observing: to witness the behaviour of the users of an existing product, system or process, to infer their necessities;
  3. Discussing: to argue with the users their necessities, with the aim of formulating an understanding about the requirements;
  4. Negotiating: to ease the negotiation among the users, to achieve agreed solutions about the requirements to be included, removed, or modified;
  5. Supposing: to anticipate functionalities that the users may need or desire, especially when new mass-market products are bring created

Groups of techniques of a requirements engineer

  1. Marketing, where there is a special interest in requirements that contribute to the commercial success of the system;
  2. Psychology and sociology, emphasising the satisfaction of the necessities of the users, the individuals and social agents;
  3. Participative design, where there is an active involvement of the users in the definition of the requirements;
  4. Human factors and human-machine interaction, whose focus is the interaction of the users with the system;
  5. Quality, in which the principal interest consists in the relation between the requirements and the system quality;
  6. Formal methods focused on the precision and mathematical rigour of the requirements specification.

Requirements Techniques

Individual Groups Artefacts
1. Interview 5. Group dynamics 7. Domain analysis
2. Survey 6. Cooperative work 8. Object-orientation
3. Introspection 9. Prototyping
4. Ethnography 10. Scenario
11. Goal modelling
12. Personna

1. Interview

2. Survey

3. Introspection

Brainstorming

  • Brainstorming eases the generation of ideas.
  • A brainstorming session congregates a group of 5 to 12 persons
  • The group suggests and explores as many ideas as possible, without criticising or judging those ideas.
  • Process: generate ideas; consolidate ideas

7. Domain Analysis

Domain Analysis

  • Analysing documentation and studying existing systems is a good source of requirements
  • presupposes analysing the upstream and downstream systems, as well as examining systems with similar purpose
  • Obtains a larger knowledge about the problem domain
  • The objective is examining the domain in which the system is located, to identify the common elements of all systems in that domain
  • Analysing documents is a technique based on searching requirements in documents, reports, and manuals.
  • The use of this technique will be possible in the future, if the artefacts for the current projects are stored

9. Prototyping

12. Personna

SUMMARY T5


T6

Models

Definition: Modelling

Modelling is the process of identifying adequate concepts and selecting abstractions to construct a model that appropriately reflects a given universe of discourse.

Characteristics of a model

  1. Abstraction. A model is a reduced description of the system.
  2. Understandability. By removing detail that is irrelevant for a given viewpoint, models, if specified in an intuitive way, allows one to more easily understand some of the system properties.
  3. Accuracy. For the properties of interest, a model provides a true-to-life representation of the system.
  4. Reasoning. A model helps in correctly analysing and reasoning about the interesting but non-obvious properties of the system, either through experimentation (e.g., by simulating the model on a computer) or some type of formal analysis.
  5. Inexpensiveness. A model must be drastically cheaper to construct and analyse than the system.

Dimensions of a model

Pasted image 20231231082800.png

1. Physical/Iconic Models

Definition: Physical Model

A reproduction at a reduced scale of a process arising in Nature.

2. Symbolic/Mathematical Models

Definition: Symbolic Model

A model which uses logical and quantitative relationships involving the dimensions of the system.

3. Descriptive Models

Definition: Descriptive Model

Models which are used to describe or mimic a real-world phenomenon or system.

4. Prescriptive Models

Definition: Prescriptive Model

A model which is used to define how a yet-to-be-built system is supposed to be.

5. Structural Models

Definition: Structural Models

A model that is focused on the static aspects of a system.

6. Behavioural Models

Definition: Behavioural Models

A model which emphasises the dynamic, functional, and temporal aspects of the system.

UML Models

model purpose
domain describe the vocabulary, concepts of the domain and characteristics of the systems that can be developed for that domain
use case describes the proposed functionalities of a given system
interaction show how the various objects or entities collaborate, emphasising the flow of control and data among them
class present a set of concepts, types and classes and the respective relations
state specify the behaviour of an entity or indicate the various states (or modes) through which it transits throughout its life
activity show the control flow among the activities of a process

1. Domain model

Definition: Domain Model

A domain model is a description of the common properties and variables of the domain related to the system that is being developed.

Pasted image 20231231092315.png

2. Use Case model

Pasted image 20231231092723.png

3. Class model

Pasted image 20231231093013.png
Pasted image 20231231093027.png
Pasted image 20231231093051.png

4. Sequence model

Pasted image 20231231093336.png

5. State Model

Pasted image 20231231093554.png

Pasted image 20231231093612.png

6. Activity Model

Pasted image 20231231093843.png
Pasted image 20231231093855.png

SUMMARY T6


T7

Principles

Definition: Principles

A principle is a comprehensive and fundamental law, doctrine or assumption. Software design principle are key notions that provide the basis for many approaches/concepts. Such design principles are:

  • Abstraction
  • Coupling and cohesion
  • Decomposition and modularization
  • Encapsulation and information hiding
  • Separation of interface and implementation
  • Sufficiency, completeness and primitiveness
  • Separation of concern

Design

Definition: Software Design

The conception or invention of a scheme for turning a specification for computer software into operational software.

Design Levels

  1. Software system
  2. Division into subsystems/packages
  3. Division into classes with packages
  4. Division into data and routines within classes
  5. Internal routine design

Software Architecture

Definition: Software Architecture

  1. Set of structures needed to reason about the system, which comprise software elements, relations among them, and properties of both.
  2. Fundamental organization of a system, embodied in its components, their relationships to each other and the environment, and the principles governing its design and evolution.

  1. The static structures of a system define its internal design-time elements and their arrangement.
  2. The dynamic structures of a system define its run-time elements and their interactions.

The fundamental properties of a system manifest in two different ways:

  1. The externally-visible behaviour defines the functional interactions between the system and its environment
  2. A quality property is a non-functional property.
Functional requirements and Software architecture

  • A software architecture is the realization of early design decisions to decompose the system into parts.
  • If two architects are given the same requirements, in general, they produce different architectures.
  • Functional requirements do not determine architecture.

What affects architecture

  1. stakeholders
  2. developing organization
  3. background and experience of the architects
  4. technical environment

Risks

The architecture choices are most important when:

  1. The solution space is small
  2. The risk of failure is high
  3. There are difficult quality attribute requirements
  4. A new domain is being considered
  5. A software’s design consists of the decisions and intentions that are in the heads of the developers.

Architecture design and detailed design

The design phase can be partitioned into two parts:

The output of design is:

Every system comprises elements and relations among them.

Dependencies

Dependencies

  • Each component plays a specific role in the system.
  • The components collaborate to provide the required functionality.
  • Minimizing dependencies between components is important to create a loosely coupled architecture.
  • By eliminating unnecessary dependencies, changes are localized and don’t propagate through the system.
  • It is necessary to decide about how the components communicate data and control information.

Coupling

Pasted image 20231231101633.png

Skeletons

Pasted image 20231231101925.png

Quality attributes

Architecture is orthogonal to functionality

What makes a good architecture?

Presumptive Architectures

Definition: Presumptive Architectures

A presumptive architecture is a family of architectures that dominates a particular domain.

SUMMARY T7


T8

Failure

Important

The concept of failure is central to the design process, and it is by thinking in terms of obviating failure that successful designs are achieved.

How much design should developers do?

  1. No up-front design: just write code
  2. Use a yardstick: spend 10% of the time on design
  3. Build a documentation package
  4. ad hoc: decide on the spot what to do

Risk-Driven Approach

Notes on the approach

  • The risk-driven approach help developers to build quality software quickly and at low cost.
  • Architects have more architecture techniques than they can afford to apply.
  • The risk-driven approach helps answer two questions:
    1. how much software architecture work should be done?
    2. which techniques should be used?
  • The risk-driven approach guides architects to apply a minimal set of architecture techniques to reduce their most pressing risks
  • Different developers perceive risks differently.
  • They choose different techniques.
  • The risk-driven model has the useful property that it yields arguments that can be evaluated.
  • Example argument: We identified A, B, and C as risks, with B being primary. We spent time applying techniques X and Y because we believed they would help us reduce the risk of B. We evaluated the resulting design and decided that we had sufficiently mitigated the risk of B, so we proceeded on to coding

The risk-driven approach follows three steps:

  1. identify and prioritize risks
  2. select and apply a set of techniques
  3. evaluate risk reduction

Architects do NOT want to:

  1. waste time on low-impact techniques
  2. ignore project-threatening risks

Architects want to:

  1. build quality systems by taking a path that spends their time most effectively
  2. address risks by applying design techniques, only when they are motivated by risks

Risk = Failure x Impact

Notes on risks

  • In engineering, risk is commonly defined as the chance of failure multiplied by the impact of that failure: risk = probability of failure x impact
  • The probability of failure and the impact are not certain, since they are difficult to measure precisely.
  • A risk can exist (i.e., one can perceive it) even if its consequences do not materialize.
  • A risk can be stated categorically, often as the lack of a needed quality attribute.
  • It is better to describe risks such that one can later test if they have been mitigated.

Kinds of risks

Note

  • Describe each risk of failure as a testable failure scenario.
  • Example: “During peak loads, customers experience user interface latencies greater than five seconds”.
  • Projects face many different kinds of risks. Each pays attention to the risks of his/her specialty.
  • Misunderstood quality attributes are a common risk.

project management risks software engineering risks
lead developer hit by bus the server may not scale to 800 users
customer needs not understood parsing of the alert messages are buggy
VP hates the product owner the system is working now, but if we
change anything it may collapse

Prototypical risks

project domain prototypical risks
IT complex, poorly understood problem
unsure the real problem is being solved
integration with existing software
domain knowledge scattered
modifiability
Systems performance, reliability, security
concurrency
composition
Web security
scalability
developer productivity / expressibility

Risk Prioritisation

Pasted image 20231231111556.png

Risk Mitigation

Risk Techniques

software engineering other engineering fields
1. design patterns 6. stress calculation
2. domain modelling 7. breaking point testing
3. throughput modeling 8. thermal analysis
4. security analysis 9. reliability testing
5. prototyping 10. prototyping
Note

  • One needs to be able to explicitly state how to choose techniques in response to risks.
  • Create a handbook with entries: if we have <\a risk>, consider <\a technique> to reduce it
  • A particular technique is good at reducing some risks but not others.
  • Ideally, there would be a single technique to address every known risk.
  • Some risks can be mitigated by multiple techniques, while other risks require techniques to be invented on the fly

Effort proporcional to risks

Important

The risk-driven approach uses this principle: architecture efforts should be proportional with the risk of failure

The effort spent on designing the architecture should be commensurate with the risks faced by the project.

Styles of design

Three design choices

The risk-driven approach is compatible with the three design styles. All of these design styles agree that design should happen at some point.

  1. In BDUF, that time is up-front.
  2. In NDUF, it means doing architecture design during development, whenever a risk looms sufficiently large.
  3. Applying it to LDUF is a combination of the other two.

1. Evolutionary design (No DUF - NDUF)

2. Planned design (Big DUF - BDUF)

BDUF is dumb, but doing NDUF is even dumber.

3. Minimal planned design (Enough DUF - EDUF / Little DUF - LDUF)

SUMMARY T8


T9

Tactics

Definition: Tactic

A tactic is a design decision that impacts on specific quality attributes.

How to use tactics?

  • A system design consists of a collection of decisions.
  • Some of these decisions help control the quality attribute responses.
  • Others ensure achievement of system functionality.
  • Each tactic is a design option for the architect.
  • For example, one tactic can introduce redundancy to increase the availability of a system. This is one possible option, among many, for the architect to increase availability.

Pasted image 20231231114807.png

Availability

Definition: Availability

Availability quantifies the percentage of time during which a given system is operational and working correctly.

Fault detection

Fault detection

  1. Ping/echo: One component issues a ping and expects to receive back an echo from the component under scrutiny. It can be used by clients to ensure that a server object and the communication path to the server are operating.
  2. Heartbeat: One component emits a heartbeat message periodically and another component listens for it. If the heartbeat fails, the originating component is assumed to have failed and a fault correction component is notified.
  3. Exceptions: One method for detecting faults is to encounter an exception, which is raised when one of the fault classes is recognized.

Fault recovery

Fault recovery

  1. Voting: Processes running on redundant processors each take the input and compute the output that is sent to a voter. Popular voting algorithm are “majority rules” or “preferred component”. Voting is used to correct faulty operation of algorithms or failure of a processor.
  2. Active redundancy: All redundant components respond to events in parallel. The response from only one component is used (usually the first to respond); the rest are discarded.
  3. Passive redundancy: One component (the primary) responds to events and informs the other components (the standbys) of state updates they must make. When a fault occurs, the system must first ensure that the backup state is sufficiently fresh before resuming services.

Fault prevention

Fault prevention

  1. Removal from service: This tactic removes a component from operation to undergo activities that prevent failures. Example: rebooting a component to prevent memory leaks to cause a failure.
  2. Transactions: A transaction is the bundling of several sequential steps such that the bundle can be undone at once. Transactions are used to prevent any data from being affected if one step in a process fails. They also prevent collisions among several simultaneous threads accessing the same data.
  3. Process monitor: Once a fault in a process has been detected, a monitoring process can delete the nonperforming process. A new instance of the process needs to be created.

Performance

Definition: Performance

Performance refers to the capacity of a system to respond to its stimulus, that is, the time necessary for responding to the events or the number of events processed by time unit.

Events

What are events? How do they work?

  • Performance tactics generate a response to an event arriving at the system within some time constraint. The event can be single or a stream and is the trigger for a request to perform computation.
  • It can be the arrival of a message, the expiration of a time interval, the change of state in the system environment, etc.
  • The system processes the events and generates a response.
  • Performance tactics control the time within which a response is generated.

Pasted image 20231231121549.png

Definition: Latency

The time between the arrival of an event and the generation of a response to it.

Resource consumption and blocked time

Resource consumption and blocked time

  • After an event arrives, either the system is processing on that event or the processing is blocked for some reason.
  • Resource consumption: Resources (CPU, data stores, network bandwidth, memory, and buffers) must be managed.
  • Access to critical sections must be made sequential.
  • All the phases to process an event contribute to the overall latency of the processing of that event.
  • Blocked time: A computation can be blocked from using a resource due to its contention or unavailability.

Three tactic categories address performance:

  1. resource demand
  2. resource management
  3. resource arbitration

1. Resource demand

Resource demand

  • Event streams are the source of resource demand.
  • Two main aspects in resource demand are:
    1. The time between events in a resource stream
    2. How much of a resource is consumed by each request
  • One tactic to decrease latency is to reduce the resources required for processing an event stream.
  • Increase computational efficiency: One step in the processing of an event is applying some algorithm.
  • Improving the algorithms decreases latency.
  • Sometimes one resource can be traded for another. For example, data may be kept in a local/fast repository to avoid getting it from a slow resource.
  • Reduce computational overhead: If there is no request for a resource, processing needs are reduced.
  • The use of intermediaries (important for modifiability) increases the resources consumed in processing an event stream, and so removing them improves latency. It is a modifiability/performance tradeoff, however.

Pasted image 20231231122828.png

  • Another tactic for reducing latency is to reduce the number of events processed.
  • Manage event rate: If one can reduce the sampling frequency at which variables are monitored, demand can be decreased. This is often possible if the system was overengineered.
  • Control frequency of sampling: If the arrival of externally generated events is not controlled, queued requests can be sampled at a lower frequency, possibly resulting in the loss of requests.

2. Resource management

Resource management

  • Introduce concurrency: If requests can be processed in parallel, the blocked time can be reduced.
  • Concurrency can be introduced by processing different streams of events on different threads.
  • Appropriately allocating the threads to resources (load balancing) is important to maximally exploit the concurrency.
  • Maintain multiple copies of either data or computations: Clients in a client-server pattern are replicas of the computation. The purpose of replicas is to reduce the contention that would occur if all computations took place on a central server.
  • Caching is a tactic to reduce contention, in which data is replicated, either on different speed repositories or on separate repositories. Since the cache data is a copy of existing data, it is relevant to keep the copies consistent and synchronized.
  • Increase available resources: Faster processors, additional processors, additional memory, and faster networks all have the potential for reducing latency.
  • Cost is usually a consideration in the choice of resources.
  • This is a cost/performance tradeoff.

How to get ideal performance

Resource demand Resource Management Resource arbitration
Increase computation efficiency Introduce concurrency Scheduling policy
Reduce computational overhead Maintain multiple copies (redundancy)
Manage event rate Increase avaliable resources
Control Frequenct of sampling

SUMMARY T9


T10

Patterns

Important

Each pattern describes a problem that occurs over and over again in our environment and then describes the core of the solution to that problem in such a way that you can use this solution a million times over without ever doing it the same way twice.

thus

Definition: Pattern

A textual description of a generic solution for a recurring problem in a given context

3 Types of patterns

  1. Creational
  2. Structural
  3. Behavioural

Three patterns are elaborated on:

  1. strategy (structural)
  2. observer (behavioural)
  3. decorator (structural)

THESE DESCRIPTIONS CANNOT BE PUT HERE IN THE NOTES. Go to the slides, 9th presentation and READ IT!


T11

Architectural style

An architectural style consists of:

  1. set of component types (e.g., process, procedure) that perform some function at runtime
  2. a topological layout of the components showing their runtime relationships
  3. a set of semantic constraints
  4. a set of connectors (e.g., data streams, sockets) that mediate communication among components

A system that conforms to a given style must use those types, which restricts the design space.

Constraints

Platonic vs. embodied

Platonic vs embodied

  • A platonic architectural style is an idealization. One finds it in books and only rarely in source code.
  • An embodied architectural style exists in real systems. It often violates the strict constraints found in platonic styles. Example: the platonic client-server style requires that servers be unaware of clients.
  • One may find embodied versions of the style where servers occasionally push data to the clients. Depending on how this is implemented, it may result in a server that depends on the clients.

Styles

Pasted image 20231231131418.png

1. Layered style

Pasted image 20231231131718.png

2. Big Ball of Mud style

3. Pipe and filter style

Pasted image 20231231133218.png

4. Batch-sequential style

Pasted image 20231231133622.png

Batch-sequential vs Pipe and filter

Batch Sequential Pipe and filter
- Coarse-grained
- High latency
- External access to input
- No concurrency
- No interaction
- Fine-grained
- Results start processing
- Localized input
- Concurrency possible
- Interaction possible

5. Model-centered style

Pasted image 20231231134310.png

6. Publish-subscribe style

Pasted image 20231231134838.png

7. Client-server style & N-tier

Pasted image 20231231135117.png

Pasted image 20231231135242.png

8. Peer-to-peer style

9. Map-reduce style

10. Mirrored, rack, and farm style