Software Engineering Methods


Software Architecture

TI3115TU -- 2024-10-10
Learning Objectives: Software architecture

  • Understand why we need to think about it
  • Understand why we need to talk about it
  • Learn different perspectives to evaluate it
  • Grasp the application of it
Rozanski's book
N. Rozanski, Software systems architecture: working with stakeholders using viewpoints and perspectives, 2nd ed. Upper Saddle River, NJ: Addison-Wesley, 2012. https://tudelft.on.worldcat.org/oclc/794554030
Management perspective
Design it
M. Keeling, Design it! from programmer to software architect. in The pragmatic programmers. Raleigh, North Carolina: The Pragmatic Bookshelf, 2017. https://tudelft.on.worldcat.org/oclc/1015687142
Applied perspective
Beautiful Architecture
D. Spinellis and G. Gousios, Eds., Beautiful architecture, 1st ed. Sebastopol, Calif: O’Reilly Media, Inc, 2009. https://tudelft.on.worldcat.org/oclc/317877836
Technical perspective

What is architecture?

Why do we need architects?

Architecture


ewi building TU Delft EWI Building 1969
Guaranty building Guaranty Building 1891

Louis Sulivan: "Form follows function"

sun glare 2
Rafael Viñoly
Vdara - 2010

Sun glare or 'The Death Ray'
walkie talkie Rafael Viñoly
20 Fenchurch Street - 2013
sun glare "A skyscraper under construction melted my Jag" + Wind tunnel effect Carbuncle Award: "a daily reminder never to let such a planning disaster ever happen again."

Work-around: Coating all windows 💸

Architecture Issues and costs


Change

Drive Jag away

Coat all windows

Alter building shape

Cost of change

Almost nothing

Very costly

Not affordable


Architectural changes are really expensive!
If not impossible

Architecture in SE


Change

How one function can be called

Enforce way to call functions

Introduce a design pattern

Convert to functional paradigm

Cost

Minutes

Hours

Weeks

Months


Architectural changes are really expensive!
If not impossible

Importance only evident when experienced
in real-life projects

big ball of mud
shitty microservices

Architecture disasters are common!
https://youtu.be/gfh-VCTwMw8

Architecture represents the significant decisions that shape a system… where significant is measured by cost of change
- Grady Booch (creator of UML)

Examples?

Significant Decisions Examples


Programming language and paradigm, Platform (Smartphone, Browser), Software Development Proccess (Open Source?, Agile?)
The 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.
- IEEE

More Examples?

Fundamental organization Examples


Integration of Cloud-services (Distribution), Data Storage, Usage of plugin system

Architecture influences
long-term software quality

Quality Properties (and environment)

Responsiveness

Reliability

Availability

Security

Usability

Maintainability

Resilience

Mostly internal quality


Lifetime

Number of Users

SW Re-use

Compatibility

Scalability and Availability

Microservices
Security

Microservices
Lifetime and maintainance

poor maintainability M. Fowler - Is quality worth cost?
https://martinfowler.com/articles/is-quality-worth-cost.html
Lifetime and maintainance

maintainability compared M. Fowler - Is quality worth cost?
https://martinfowler.com/articles/is-quality-worth-cost.html
SW Re-Use

Free and Open Software

Building on top of existing Software

Compatibility

Using established protocols

bounded context

Integrate into business processes

M. Fowler - Bounded Context
https://martinfowler.com/bliki/BoundedContext.html

And many more internal qualities


Modularity, Maintainability, Usability...
The 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.

Architecture is the important stuff.
Whatever that is.
- Ralph Johnson and M. Fowler

Who decides?

Example: MediaWiki
wikipedia logo
wikipedia logo

Functions? Issues? Priorities?

MediaWiki ('general')
mediawiki general architecture
MediaWiki (security)
Because MediaWiki is the platform for high-profile sites such as Wikipedia, core developers and code reviewers have enforced strict security rules. To make it easier to write secure code, MediaWiki gives developers wrappers around HTML output and database queries to handle escaping. To sanitise user input, one uses the WebRequest class, which analyzes data passed in the URL or via a POSTed form. It removes "magic quotes" slashes, strips illegal input characters and normalises Unicode sequences. Cross-site request forgery (CSRF) is avoided by using tokens, and cross-site scripting (XSS) by validating inputs and escaping outputs, usually with PHP's htmlspecialchars() function. MediaWiki also provides (and uses) an HTML sanitiser with the Sanitizer class, and database functions that prevent SQL injection
MediaWiki (responsiveness vs usability)
MediaWiki must not only run a top-ten website, but also do so on a shoestring budget. To meet these demands, MediaWiki has a heavy bias towards performance, caching and optimisation. Expensive features that can't be enabled on Wikipedia are either reverted or disabled through a configuration variable; there is an endless balance between performance and features
MediaWiki (Compatibility)
Wikipedia users originally created "bots" that worked by screen scraping the HTML content served by MediaWiki; this method was very unreliable and broke many times. To improve this situation, developers introduced a read-only interface (located at query.php), which then evolved into a full-fledged read and write machine APIproviding direct, high-level access to the data contained in the MediaWiki database.
MediaWiki (maintainability)
MediaWiki started without any of these things, but all of them support features that have been around since the beginning. Many developers are interested primarily in feature development, and architecture is often left behind, only to catch up later, as the cost of working within an inadequate architecture becomes apparent.

Exercise


How does cryptpad present its architecture?
Which qualities does its architecture focus on?
xwiki qr code
https://docs.cryptpad.org/en/dev_guide/general.html

Presentation of architecture

Who is the audience?

Why is it published?


Architecture is the important stuff.
Whatever that is.

Important stuff: realtive to perspective and view!

Architecture is the important stuff.
Whatever that is.

A good architecture addresses concerns of people.

Balances them in case of conflict.

Is acceptable for everyone.


Good architecture requires discussion

How do we show/discuss architecture?

Impossibility to show/plan everything with one model

What do you want to show?

Whom do you want to show it to?

Seperation into Views/Viewpoints

details of guaranty building
Guaranty building floorplan Views of particular aspects

Goal: Represent complex system in a way that is manageable and comprehensible by a range of people

Seperation into Views/Viewpoints


One View describes a separate structural aspect

Appropriately illustrate how concerns of people are addressed by architecture

Separation into Views/Viewpoints


Development view: Describes the architecture that supports the software development process. Development views communicate the aspects of the architecture of interest to those involved in building, testing, maintaining, and enhancing the system
Operational view: Describes how the system will be operated, administered, and supported when it is running in its production environment. The aim of the Operational viewpoint is to identify system-wide strategies for addressing the operational concerns and to identify solutions that address these.

Other viewpoints we can think off?

Separation into Views/Viewpoints


Functional view: Describes the system’s runtime functional elements, their responsibilities, interfaces, and primary interactions. It also has a significant impact on the system’s quality properties such as its ability to change, its ability to be secured, and its runtime performance.
Information view: Describes the way that the system stores, manipulates, manages, and dis- tributes information. The objective of this analysis is to answer questions around content, structure, ownership, latency, references, and data migration.

Perspectives and Views


Consider different aspects of a viewpoint

Information Security:
How does the information view address security?

Development Usability:
How is the usability of technology for developers ensured?

Functional Evolution:
How can functions being added in the future?

Development Security:
How are contributions verified?

Perspectives and Views



Wikipedia users originally created "bots" that worked by screen scraping the HTML content served by MediaWiki; this method was very unreliable and broke many times. To improve this situation, developers introduced a read-only interface (located at query.php), which then evolved into a full-fledged read and write machine API providing direct, high-level access to the data contained in the MediaWiki database.

Different view, different modelling techniques

C4 Overview
Way to help software development teams describe and communicate software architecture.
C4 Overview
Way for amazon to help sell a product.

Architecture Patterns


Re-usable solutions for common concerns

Architecture Patterns


Solutions for subcomponents (specific views and perspectives)

Address specific concerns

Introduce trade-offs

Architecture Patterns


Client Server Model

Business Logic on Server

Multiple clients; One server

Connection via network

Clients "consume" services


Example: Client Server Model
(any simple website)

Architecture Patterns


Client Server Model

+ Total control of server

+ Allows "thin" clients

- Network performance??

- Single point of failure


Example: Client Server Model
(any simple website)

Architecture Patterns


Client Server Model

Distributed Logic

Connection via network

Clients also provide

Advantages??

Trade-offs??


Example: Peer to peer
(Bit Torrent)

Architecture Patterns


Client Server Model
Which views does the peer-to-peer pattern concern?

Other Common Architecture Patterns


Cloud and Cloud-native

Microservices

Event-Driven

DevOps

Open Source Contribution Pattern

📚 M. Keeling, Design it! 2017. Chapter 7
https://tudelft.on.worldcat.org/oclc/1015687142

Chose for architecture
before it chooses you

Whether it be the sweeping eagle in his flight, or the open apple-blossom, the toiling work-horse, the blithe swan, the branching oak, the winding stream at its base, the drifting clouds, over all the coursing sun, form ever follows function, and this is the law. - Louis Sullivan (1896)
Form follows function:

Applicable in SW architecture?

It's not that simple!

Guaranty building
If ‘form follows function,’ it does not follow in a straight line, nor in accordance with a simple mathematical formula, but along the lines of curves whose elements are always changing and never alike; and if the lines of development and growth of the vegetable and animal organisms are infinitely differentiated, the process of untrammeled human thought and human emotions are even more subtle in the differences and shadings of their manifestations - Dankmar Adler (1896)
Function and environment
determine form
Guaranty building

Chose for architecture
before it chooses you


"Form" of software is a result of environment

Available Technology, Social fabric, Communication structure

Conway's law
Guaranty building
Organizations which design systems (in the broad sense used here) are constrained to produce designs which are copies of the communication structures of these organizations - Mel Conway (1986)

"Function follows Form"

Architecture emerges or disintegrates

Recap git branching lecture

earlier slide

Forced worflows/architectures will disintegrate

What makes a good SW architect?


Facilitates and does not dictate

Understands needs of people involved

Is experienced with material/technologies

Knows a wide repertoire of patterns

Is able to use knowledge/experience of others

Concluding summary


  • SW Architecture reflects significant decisions
  • It facilitates all aspects of software quality
  • It is described/perceived through different views
  • We can re-use Arch. patterns to address needs
  • It always emerges from the organisational context