Lecture Notes
Live Lecture 1, Jan 18, 13-15, Course Introduction
Here is the recorded lecture Links to an external site.
Live Lecture 2, Jan 20, 13-15, Guest Lecture on Git
This lecture, held by Simone Stefani, covers advanced Git concepts and Git workflows.
Here's the recorded lecture Links to an external site.
Simone's presentation is here, Let’s talk Git - Basics & Workflows 2022 (with comments).pdf Download Let’s talk Git - Basics & Workflows 2022 (with comments).pdf. There are also more resources at his web site, https://simonestefani.dev/ Links to an external site..
Live Lecture 3, Feb 7, 13-15, Guest Lecture
Guest lecture by Daniel Hederstedt, a former TIDAB student who has been working with software development and architecture for over ten years.
Here's the recorded lecture Links to an external site.
Prerecorded Lecture 1, Architecture Introduction
Introduction to Architecture Links to an external site.
Content
00:00
Links to an external site. Lecture Content
00:38
Links to an external site. Definition of Architecture
08:20
Links to an external site. Why Architecture Is Important
16:08
Links to an external site. Definition of Non-Functional Requirements
20:21
Links to an external site. Availability
20:46
Links to an external site. Reliability
21:04
Links to an external site. Response Time
21:17
Links to an external site. Capacity
22:00
Links to an external site. Scalability
27:16
Links to an external site. Manageability
27:34
Links to an external site. Configurability
27:52
Links to an external site. Packaging
27:57
Links to an external site. Standards
28:02
Links to an external site. Use Certain Software or Hardware
28:17
Links to an external site. Usability
29:12
Links to an external site. Security, Introduction
29:53
Links to an external site. Authentication
30:01
Links to an external site. Authorization
30:10
Links to an external site. Non-Repudiation
30:29
Links to an external site. Integrity
30:35
Links to an external site. Privacy
30:49
Links to an external site. Logging
31:01
Links to an external site. Design Goals, Introduction
32:43
Links to an external site. Adaptability/Extensibility
32:57
Links to an external site. Portability
33:16
Links to an external site. Interoperability
33:28
Links to an external site. Testability
34:46
Links to an external site. Reusability
Here is the presentation used in the video above, architecture.pdf Download architecture.pdf
Prerecorded Lecture 2, Architectural Decisions
Taking architectural decisions. Links to an external site.
Content
00:00
Links to an external site. Lecture Content and Lecture Notes
00:41
Links to an external site. Introduction to Architectural Decisions
03:40
Links to an external site. What to Consider When Taking Decisions
03:59
Links to an external site. Documenting Decisions
05:19
Links to an external site. Where to Start the Project
Here is the document about architectural decisions mentioned in the video above, taking-decisions.pdf Download taking-decisions.pdf
Prerecorded Lecture 3, REST Architecture
REST Architecture Links to an external site.
Content
00:00
Links to an external site. Lecture Content
00:28
Links to an external site. The REST Principles
03:21
Links to an external site. Addressable Resources
06:38
Links to an external site. A Uniform, Constrained Interface
11:36
Links to an external site. Representation-Oriented
13:25
Links to an external site. Stateless Communication
14:03
Links to an external site. HATEOAS
17:37
Links to an external site. Server-Side Rendering, SSR
19:01
Links to an external site. Client-Side Rendering, CSR
20:07
Links to an external site. Advanatges of SSR and CSR
22:27
Links to an external site. The MVVM Pattern
27:12
Links to an external site. Using AJAX for CSR.
Here is the presentation used in the video above, rest-csr.pdf Download rest-csr.pdf.
Prerecorded Lecture 4, Modularization and Microservices
Modularization and Microservices Links to an external site.
Content
00:00
Links to an external site. Lecture Content
00:32
Links to an external site. Software Layers
03:15
Links to an external site. Monolith
13:14
Links to an external site. Microlith
19:50
Links to an external site. Communication Between Services
23:30
Links to an external site. Event Sourcing
31:23
Links to an external site. CQRS
34:46
Links to an external site. Microservices
41:45
Links to an external site. Function-as-a-Service, FaaS
46:44
Links to an external site. Domain-Driven Design, DDD
Here is the document mentioned in the video above, modularization-micserv.pdf Download modularization-micserv.pdf.
Prerecorded Lecture 5, A Server-Side Application
This lecture covers the programming skills required to start working with the project task. You will have to learn a lot more, on your own, to complete the project task. Note that there are three different versions of this lecture, you are only required to learn the content of (at most) one of them. Which one to watch depends on architectural decisions taken by your group, namely which frameworks to use, whether to use server-side rendering or client-side rendering, and whether to use a monolithic architecture or micro services.
You are not allowed to copy any code from any of the sample applications below, no matter how much you adapt it to your own application. You are, however, allowed to write code yourself that is very similar to the applications below.
Version 1, Server-Side Rendering with a Monolithic Architecture
This application is written in Java, with the Spring framework, and uses server-side rendering. Note however that there is no problem using Spring also for client-side rendering, rather it's even easier than using Spring for server-side rendering. This architecture is used in most code examples in other lectures.
Videos explaining this application can be found at https://canvas.kth.se/courses/16729/pages/application-server-lectures. As can be seen, they were originally recorded for ID1212, Network Programming. Therefore ignore everything in the videos that is mentioned about 'the course' or about assignments, since that isn't about this course, IV1201.
The page with the videos, see the link above, also has a link to a GitHub repository where you can find that application. You might however instead want to look at this application, https://github.com/KTH-IV1201/bank.git, Links to an external site. which is an extended version of the same program, including for example tests.
Version 2, Client-Side Rendering with a Monolithic Architecture
This application is written in JavaScript, with the Express framework, and uses client-side rendering. Note however that there is no problem using Express also for server-side rendering. There are some code examples in other lectures using this architecture.
The application can be found at https://github.com/KTH-IV1201/chat.git Links to an external site.
Here is a pdf with a presentation explaining the application, node-express-sequelize.pdf Download node-express-sequelize.pdf.
Here are videos explaining the application.
A REST Application, Part 1 Links to an external site.
Content
00:00
Links to an external site. How This Lecture Fits in the Course
08:48
Links to an external site. Lecture Content
10:45
Links to an external site. Executing the Sample Application
16:11
Links to an external site. The Express.js framework
27:52
Links to an external site. Layers in the Sample Application
30:51
Links to an external site. Startup Code, Part 1
32:21
Links to an external site. Configuration Parameters
36:01
Links to an external site. Startup Code, Part 2
55:01
Links to an external site. Error Handling
A REST Application, Part 2 Links to an external site.
Content
00:00
Links to an external site. Database Handling
15:47
Links to an external site. Handling an HTTP call, createMsg
16:56
Links to an external site. Handling the HTTP call in the view
21:57
Links to an external site. Authentication and Authorization
27:04
Links to an external site. Reading User Data From Database
36:09
Links to an external site. Handling the HTTP call in the controller
36:40
Links to an external site. Handling the HTTP call in the DAO
37:53
Links to an external site. Sending HTTP Respone
Version 3, Client-Side Rendering with a Micro Services Architecture
This application is written in JavaScript, with the Nest framework, and uses client-side rendering. It is quite different from the applications above in the sense that it has a micro services architecture. In one way, using this solution you get quite a lot for free since this sample application is in fact a recruitment application, very similar to what you shall develop in the project. On the other hand, this architecture is more complicated than the ones above. Also, there is no lecture or tutorial explaining this solution.
This application can be found here, https://github.com/philipromin/Recruitment Links to an external site.. Thanks to Philip Romin, who developed this application for his bachelor thesis.
Prerecorded Lecture 6, Development Tools
Tools, Part 1: Build, Test and CI/CD
Links to an external site.
Content
00:00
Links to an external site. Lecture Content
06:25
Links to an external site. Maven
29:14
Links to an external site. npm
43:16
Links to an external site. In-Container vs Mocked Tests
49:40
Links to an external site. Spring MVC Test Framework
01:00:59
Links to an external site. Jest
01:13:47
Links to an external site. CI/CD
01:29:42
Links to an external site. Containerization, Docker
Tools, Part 2: Static Analyzers, Dependency Analyzers and Test Coverage Links to an external site.
Content
00:00
Links to an external site. Static Analysis
06:25
Links to an external site. Dependency Analysis
10:31
Links to an external site. Test Coverage Analysis
- This presentation, tools-cli-java.pdf Download tools-cli-java.pdf, gives examples of tools for Java development. It refers to the sample application at https://github.com/KTH-IV1201/bank.git Links to an external site..
- This presentation, tools-cli-js.pdf Download tools-cli-js.pdf, gives examples of tools for JavaScript development. It refers to the sample application at https://github.com/KTH-IV1201/chat.git Links to an external site..
Prerecorded Lecture 7, Architecture, Design and Non-Functional Requirements on the View
The quality of this recording is unfortunately quite low. The sound is far from perfect, the video is blurred the first seconds of each part, and the zoom chat window covers part of the presentation.
Requirements on the presentation layer, part 1 Links to an external site.
Content
00:00
Links to an external site. Lecture Content
01:25
Links to an external site. Typical Layers in a Web App
04:32
Links to an external site. The Client Layer
14:35
Links to an external site. Caching
23:36
Links to an external site. Navigation
27:26
Links to an external site. Validation
37:06
Links to an external site. Flow Control
40:22
Links to an external site. Composite Views
Requirements on the presentation layer, part 2 Links to an external site.
Content
00:00
Links to an external site. Internationalization
08:20
Links to an external site. Session Management
13:03
Links to an external site. Error Handling
23:45
Links to an external site. Logging
26:46
Links to an external site. Authentication and Authorization
28:43
Links to an external site. Authentication in a REST API
40:15
Links to an external site. JSON Web Tokens, JWT
Here are the presentations used in the videos.
- Requirements on the presentation layer, requirements-presentation.pdf Download requirements-presentation.pdf.
- Security aspects of a web application, security.pdf Download security.pdf,
Prerecorded Lecture 8, Architecture, Design and Non-Functional Requirements on the Model
Requirements on the controller and model layers Links to an external site.
Content
00:00
Links to an external site. Lecture Content
01:23
Links to an external site. Statefullness
07:04
Links to an external site. Synchronization With the Database
14:00
Links to an external site. Error Handling
21:36
Links to an external site. Internationalization
22:28
Links to an external site. Security
22:51
Links to an external site. The DTO Pattern
Here is the presentation used in the video, Requirements on the model layer, requirements-model.pdf Download requirements-model.pdf.
Prerecorded Lecture 9, Transactions
There's an introduction to transactions at https://canvas.kth.se/courses/27118/pages/transactions. As can be seen, it was originally recorded for IV1351, Data Storage Paradigms. Therefore ignore everything mentioned about 'the course' or about assignments, since that isn't about this course.
Watch the transaction introduction lecture above before watching this lecture on Transaction handling in a web application Links to an external site.
Content
00:00
Links to an external site. Where to find an introduction to transactions
00:58
Links to an external site. Start and stop transactions in the controller
04:48
Links to an external site. Every operation needs a transaction
12:00
Links to an external site. Always use declarative transactions
16:03
Links to an external site. Never lock anything manually
19:55
Links to an external site. State that's not handled by the transaction manager
27:57
Links to an external site. Summary of transaction handling in a web app
30:08
Links to an external site. Transactions in Spring
37:10
Links to an external site. Transaction in Sequelize
43:44
Links to an external site. Non-Transactional Resources
45:51
Links to an external site. Use cases spanning more than one transaction
Here is the presentation used in the video, transactions.pdf Download transactions.pdf.
Prerecorded Lecture 10, A Few Words About Document Databases
There are no requirements on databases or on the integration layer in the project, except that they shall exist and follow general guidelines applying to the entire application. Still, since each year one or a few groups are interested in using a document database instead of a relational database, there is here an introduction to document databases. There is also a comparison of relational and document databases, with the goal to show that database type shall be chosen based on application, not based on programming language or framework stack. This material was originally created for another course, therefore ignore anything mentioned about the course.
This document explains major differences between document and relational databases, and also covers strengths and weaknesses of the two, doc-db.pdf Download doc-db.pdf. There is no video lecture covering the content of this document, instead care has been taken to cover everything in writing.
This document, a_comparison_of_backend_and_DB_in_regards_to_response_time.pdf Download a_comparison_of_backend_and_DB_in_regards_to_response_time.pdf, is an evaluation of response times for both web servers and DBMSs and might be of interest when choosing framework, server and DBMS. It's also of interest because it was written by a student of this course, as a solution to the task Other Non-Functional Requirements in the list of assignments in the document tasks-affecting-grade.pdf, and thus is an example of how this task can be answered.
An example application using a document database can be found at https://github.com/KTH-IV1351/doc-db-intro.git, and is explained in the video below.
Accessing a Document Database Programmatically Links to an external site.