Software Architecture (2021/22)

VO/KU (706.706/706.707)

This course highlights the importance of developing a software architecture for complex software systems. The course focuses on investigating properties of proven software architectures and involves students in applying those architectures in a practical software project. After finishing the course the participants will be able to understand the challenges in building complex software systems, analyse the requirements, prioritize the quality attributes and goals, and create a suitable software architecture matching the defined criteria.

The main instructor of the course is Roman Kern, and if there are open questions, please feel free to send an e-mail with a prefix [SA] in the subject.

The study assistant is Srđan Džombić, dzombic@student.tugraz.at, who is responsible for the projects and practical aspects.

About


Content

Course topics include:

  • Definitions of systems, software systems, and complexity
  • Definition of software architecture
  • Analysis and design of software architecture
  • Architectural views
  • Conceptual, execution, and implementation view on software architecture
  • Architectural prototype in an OO programming language
  • Architectural styles
  • Real-world examples: Web and service architectures, big distributed architectures,...

Theoretical Goals

In this course the students will learn about:

  • Importance of developing a software architecture
  • A particular notation for describing a software architecture
  • Different views on software architecture
  • Proven software architectures
  • Software quality attributes
  • Successful systems and their software architectures
  • Architectural patterns
  • Heterogeneity of software architectures

Practical Goals

At the end of this course the students will know how to:

  • Analyse the requirements to obtain a conceptual architecture
  • Design an execution and an implementation architecture
  • Address both functional and non-functional requirements
  • Design and implement an OO architectural prototype by following a set of OO design principles
  • Document all the steps

Lectures


Slides and Videos

The lectures are provided via TeachCenter, including the slides and videos. They will be uploaded in course of the semester.

Q&A Sessions

Additionally, there will be interactive sessions (not mandatory) - provided in the lecture hall, as well as online via WebEx. Please see the course schedule for details.

Materials


Supplemental Material

Online resources

Books

Examination VO (706.706)


Method, grading

There are multiple alternative options for the exam, depending on the current regulations and preferences.

Option: Written exam

Depending on the current situation/regulations there is the option of a written exam conducted in the lecture hall.

Each student gets 5 questions for 5 selected topics (2 points per answer), plus 3 open questions (10 points each). For every student the questions are randomly selected from the topic question pool. There are around 20 questions in each topic question pool. Thus, every student gets a different set of questions.

Option: Oral exam

The next option is an oral exam conducted online via a video conferencing tool (currently: WebEx) and a few supplemental tools (currently: Online whiteboard). As such, a stable and fast internet connection is required.

In order to participate in an oral exam, one needs to be registered via TUG-Online for the exam. Typically, there will be a friendly reminder e-mail sent out a few days before the examination containing information about the link to participate and also a link and date to test the connection and setup.

The examination itself is conducted in slots of five participants, each scheduled for one hour. Each participant gets 4 open questions, comprising 2 questions with 5 points each (e.g., enumerations) and 2 questions with 10 points each (e.g., sketches, mock-ups). Next there are 5 theoretical questions, each associated with 10 points and from different question topics. The maximum amount of points is then 80 points.

Option: Homework

Due to the special circumstances, there will an additional option to obtain points. There will be a written homework, which is non mandatory. Each enrolled participant may choose to hand in the filled out homework. The questions will be posted on the TeachCenter and their availability will be announced via e-mail. The answers are also expected to be uploaded to TeachCenter

Deadline for the submission of the homework is: Wednesday, 27.01.2022

Grading scheme

  • 0-40 points: 5
  • 41-50 points: 4
  • 51-60 points: 3
  • 61-70 points: 2
  • 71-80 points: 1

Exercise KU (706.707)


There is one study assistant who support, supervise and grade students in their practical work. The study assistant is Srđan Džombić. Please feel free to contact your study assistant at dzombic@student.tugraz.at for any questions that arise during this course.

The goal for the practical part of the course is to apply the theoretical findings that are discussed in the lecture in practical settings. For that purpose the students will develop a software architecture and implement an architectural prototype for a web based system. The project is carried out in a team of 2 students. Please use TeachCenter to form groups.

The programming language, the database and the operating system can be freely chosen by the participants. The code should run on a notebook and each group should demonstrate their running applications at the submission interviews with their own computer (or with screen sharing).

Please make sure that your code is easily readable, reusable and maintainable.

Deadlines

The exercise is split into four separate tasks - thus the timeline is:

  • Group registration until: 17.10.2021 (23:59)
  • Deadline for the project submission is the 05.12.2021 (23:59)

Submission

Handing in the submission is done via TeachCenter. Please ZIP your project with folder structure as folder-per-task submit it.

The submission interviews will be held on 09.12.2021 and 10.12.2021.

Grading

There are a total of 40 points to achieve. The overall grading is based on the implementation of the application, but there is the option of point deduction if the given answers at the submission interviews are inadequate.

The grading scheme is as follows:

  • 0-20 points: 5
  • 21-25 points: 4
  • 26-30 points: 3
  • 31-35 points: 2
  • 36-40 points: 1

There needs to be a submission for each of the tasks in order to qualify for a positive grade.

Description

The goal of the exercise is to implement a database-based application with logging service, while using microservices software architecture styles. The data for the application is taken from OpenStreetMap and should be filtered for cafes, bars, pubs, restaurants and fast foods in Graz. The user should be able to find any of these by coordinates inside a bounding box (specified area) and/or a specified category (e.g. fast foods only). A bounding box marks the area in which the application should search for the specified restaurants, cafes etc. The middle of the bounding box are the given coordinates and its size should be adjustable by the user (e.g. 100m times 100m). Additionally the user needs to be able to add, edit and remove individual restaurants, cafes, bars, pubs and fast foods.

The tasks are:

  1. Pipeline Architecture (Unix command line)
  2. Single Database Microservice for database updates (API)
  3. Logging Microservice communicating over Message Broker with first microservice
  4. Containerization and orchestration of two previous microservices

The datasets:

Task 1 (Unix command line - 7 points)

Write one Unix command pipeline to import the data-set into a database, making use of the pipe architecture and command line tools. After executing the command chain, the database should be completely populated. For this, the data will be processed, converted to CSV, filtered and then stored in the database.

Download OpenStreeMap-Data for Austria: (austria-latest.osm), write a Unix command pipeline that solves following tasks:

  • Use osmfilter in order to keep ALL required nodes (cafes, bars, pubs, restaurants, and fast foods)
  • Filter those just within Graz.
    • To do this, you can use this .poly file: (Graz.poly)
  • Use osmconvert for converting it to CSV. You have to save at least the id, longitude, latitude, name and opening hours of the node (Feel free to add as many metadata as you wish to use it in your application for bonus points, e.g. opening hours).
  • Use only standard linux-console-programs (awk, sed, grep, ...) in order to filter out nodes that do not have a name, if there are empty ones.
  • Load the content into a database of your choice (e.g. Postgres)

The creation of the database and table(s) also needs to happen in the pipeline. Furthermore, the pipeline must not fail if the database or the table(s) already exist. You may use a script to create the necessary database infrastructure or import the data, but the script needs to be executed from your pipeline.

Note: You may use permanent files but there must be at least three ‘|' chainings or redirect operators (‘>', ‘<‘) within the pipeline. For example: cat /proc/cpuinfo | grep -A 5 -B 5 MHz | grep 'core id' | awk NR==1

Task 2 (Single Database Microservice with API - 12 points)

Write a web service with API routes for adding, modifying and deleting data stored in created database from previous task, which are accessible from e.g. terminal (with curl) or Postman. The overall goal is an accessible point to modify the database (add, edit and delete data). You also need to submit OpenAPI specification of your REST API service (it could be Swagger YAML or JSON file) - not submitting this file will lead to point deduction.

List of requirements:

  • List and filter nodes by category, name, around a coordinates (e.g. 100m). All 3 filters have to be combinable, but need to work independently as well. (4 points)
  • Add new node (2 points)
  • Edit node partially - with only required data you want to change (2 points)
  • Replace an existing node - edit node fully (2 points)
  • Delete an existing node (2 points)
  • When adding/fully editing a node name, coords and id is always required - when it is not present those route should result in 400 Bad Request HTTP Status Code (-1 point per route when not handled)
  • Every error which comes up at editing/deleting a not existing node must be properly handled with 404 HTTP Status Code (-1 point per route when not handled)
  • Every other HTTP method other than implemented one should result in 405 Method Not Allowed HTTP Status Code (-2 points when not handled)

Make sure that all functionality needs to be within one service, the only external service will be the database in this task.

Task 3 (Logging Microservice - 15 points)

Create a logging microservice for task 3 which will communicate over message broker with microservice from task 2. Which message broker you will choose is freely up to you. I would advice you to use Kafka because it is easier to put it in work together with task 4.

List of requirements:

  • Make script to initialize message broker with proper topic(s)- it can be put in script from task 1 or in separate script. (1 points)
  • Make script to instantiate elasticsearch database - it can be put in script from task 1 or in separate script (together in script from previous point). (1 point)
  • Expand your first microservice to instantiate connection as "producer" with message broker. (2 points)
  • Expand your routes to send logs over message broker. Every event (successful or resulting with error) on every route should be logged. (1 point per route)
  • Make new microservice (logging microservices) which will be connected as "consumer" to message broker, make (form) logs in desired format from inputs and save it in elasticsearch database (5 points)
  • Elaborate your log format, your fields you are logging and why it is important - please take in mind what would be useful to debug microservices, i.e. timestamp, service id, request id, request type etc. and write it as PDF (2 points)

Task 4 (Docker containerization and orchestration - 6 points)

Microservices created in second and third task should be containerized and together with elasticsearch and kafka orchestrated with docker-compose. Orchestration of script from first task (together with database) is not mandatory but advised.

List of requirements:

  • Dockerize every created microservice, Kafka and Elasticsearch. Connect containers with Docker Compose (6 points) - you are able to use Docker-Compose template file from our GitHub Repo

My advice is to use Docker from the start, since you will make your development easier. However, it will still be graded on second submission.

Notes: You will need to provide all Dockerfiles within your submission! If I cannot run your submission (with docker-compose up), I will deduct you some of previously gained points.