Commit 1652ddd5 authored by George Adrian Stoica's avatar George Adrian Stoica
Browse files

add slides for 12th lecture

parent d2872375
Pipeline #86231 passed with stage
in 3 minutes and 42 seconds
= Modular software
:customcss: slides.css
:icons: font
:includedir: revealjs/includes/
:LECTURE_TOPIC: Modular software
:LECTURE_NO: 12th Lecture
include::{includedir}header.adoc[]
[.smaller-80][.center-paragraph]
IT1901 Fall 2020 - {LECTURE_NO}
== Overview
- Group deliverable 2
- Architectural styles
- Modular projects with Maven
== Group deliverable 2
- modularisering
** kodingsprosjektet skal deles opp i egnede moduler med avhengigheter mellom (og til andre, relevante moduler)
** bygging styres (fortsatt) av maven og hver modul har hensiktmessig konfigurasjon
[.smaller-80]
== Group deliverable 2 (cont.)
- arkitektur (full tre-lags arkitektur)
** kjernelogikken og ui-et skal skilles fra hverandre (domenelaget + brukergrensesnittlaget )
** persistens med JSON og Jackson evt. alternativt bibliotek (persistenslaget)
*** definere filformat for brukerdata og evt. innstillinger
*** reflektere over og velge mellom dokumentmetafor (desktop) og implisitt lagring (app)
** alle tre lagene spiller sammen
== Group deliverable 2 (cont.)
- kodekvalitet
** tester skal skrives for all modulene
** testdekningsgrad (Jacoco) og (annen) kodekvalitet skal sjekkes av egne tillegg ( for eksempel Checkstyle og Spotbugs som plugins)
** rimelig god testdekning av alle lagene
== Group deliverable 2 (cont.)
- dokumentasjon
** dokumentasjon (readme filer og kommentarer) må oppdateres
** dokumentere arkitektur med minst et diagram (bruk PlantUML) i tillegg til teksten i readme
[.smaller-80]
== Group deliverable 2 (cont.)
- arbeidsvaner
** kodingsoppgaver skal være utgangspunktet for alt arbeid (Issues for alle ting som skal gjøres)
** greiner (branch) samler arbeid for hver kodingsoppgave
** bruk milepæl (milestones) knyttet til innleveringen
** dere jobber i par og bytter på å kode
[.smaller-80]
== Group deliverable 2 (cont.)
- leverer på gitlab
** prosjektet må være gitpod-klart, så vi kan åpne det i gitpod fra en merkelapp i repoet
** maven skal brukes til kjøring av applikasjonen, testene og av kodekvalitet sjekker
** kode for vurdering må leveres i mastergreina av standard repo for gruppen (https://gitlab.stud.idi.ntnu.no/it1901/groups-2020/gr20nn/gr20nn)
- På Blackboard leverer dere en enkel tekst som nevner at repo-et er klart for vurdering.
- Hvis dere leverer etter fristen, informerer du lærerassistenten.
== Architectural styles
An architectural style is a conceptual specification of how a certain
system will be structured and function.
== Architectural styles
- monolithic applications
- 3-tier applications
- REST
== layers vs tiers
- sometimes the terms are used interchangeably
- there is a difference
** layers - logical separation
** tiers - physical separation
[background-color = "#124990"]
[color = "#fff6d5"]
== monolithic applications
== monolithic applications (1)
- All the functionality is packed in a single software unit
** presentation
** logic
** data
- designed without modularity
- also called single-tiered application
== !
image::../images/lecture12/1tier.png[canvas, size=contain]
[background-color = "#124990"]
[color = "#fff6d5"]
== 3-tier applications
== !
image::../images/lecture12/3tier.png[canvas, size=contain]
== 3-tier applications (2)
- application where the various functions are separated
** presentation tier (UI / frontend)
** logic tier (business tier)
** data tier (data storage + data access)
- also called 3-layer
- application is modular
== 3-tier applications (3)
- ability to update / replace just parts of the application
- ability to independently scale the layers
- ability to re-use layers
[background-color = "#124990"]
[color = "#fff6d5"]
== REST
[.smaller-80]
== REST
- Representational state transfer (REST)
- architectural style involving use of Web Services
- set of constraints are applied
** client server
** statelessness (no client context is stored on the server side)
** cacheability (responses state if they can be cached or not)
** uniform interface
** layered system (adding layers like proxy or load balancer)
== REST (cont.)
- Web services that implement REST are called RESTful APIs
- a base URI, example: https://gitlab.stud.idi.ntnu.no/api/v4
- standard HTTP methods (e.g., GET, POST, PUT, PATCH and DELETE);
- data formats for requests and responses (json, xml, etc)
== !
image::../images/lecture12/itodo.png[canvas, size=contain]
== !
image::../images/lecture12/mtodo.png[canvas, size=contain]
== !
image::../images/lecture12/rtodo.png[canvas, size=contain]
[background-color = "#124990"]
[color = "#fff6d5"]
== Modular projects with Maven
== Modular projects with Maven
- use of inheritance
- parent `pom` has configuration that is inherited by modules' `pom`
- the descendent `pom` can override inherited configuration elements
- descendant `pom` inherits most elements with the exception of things like artifactid, name which are used to identify the parent `pom`
== Modular projects with Maven (2)
- reduce complexity and size of individual build files
- reliably use consistent versions for dependencies and plugins
== Parent pom example
```xml
<?xml version="1.0" encoding="UTF-8" ?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>it1901.todolist</groupId>
<artifactId>parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
...
</dependency>
...
</dependencies>
</dependencyManagement>
<build>
<pluginManagement>
<plugins>
<plugin>
...
</plugin>
...
</plugins>
</pluginManagement>
</build>
<modules>
<module>core</module>
<module>fxui</module>
</modules>
</project>
```
== Descendant pom example
```xml
<?xml version="1.0" encoding="UTF-8" ?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>it1901.todolist</groupId>
<artifactId>parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>fxui</artifactId>
<dependencies>
<dependency>
...
</dependency>
...
</dependencies>
<build>
<plugins>
<plugin>
...
</plugin>
...
</plugins>
</build>
</project>
```
include::{includedir}footer.adoc[]
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment