From 114f047302384eef4a12f578b1d26bc99fb3d457 Mon Sep 17 00:00:00 2001 From: Adrian Stoica <stoica@ntnu.no> Date: Thu, 31 Aug 2023 12:47:04 +0200 Subject: [PATCH] edit: updates lecture 4 slides --- lectures/revealjs/04-individual-oblig.adoc | 310 +++++++++++++++++++++ 1 file changed, 310 insertions(+) create mode 100644 lectures/revealjs/04-individual-oblig.adoc diff --git a/lectures/revealjs/04-individual-oblig.adoc b/lectures/revealjs/04-individual-oblig.adoc new file mode 100644 index 0000000..b0437dc --- /dev/null +++ b/lectures/revealjs/04-individual-oblig.adoc @@ -0,0 +1,310 @@ += Individuell obligatorisk øving +:customcss: slides.css +:icons: font +:includedir: includes/ +:LECTURE_TOPIC: Øving 1 +:LECTURE_NO: 4th lecture + +include::{includedir}header.adoc[] + +[.smaller-80][.center-paragraph] +IT1901 Fall 2023 - {LECTURE_NO} + +[background-color = "#124990"] +[color = "#fff6d5"] +== Overview + +- Administrative issues +- Individual exercise +- Build tools +- Summary + + +[background-color = "#124990"] +[color = "#fff6d5"] +== Administrative issues + +== Groups + +- fill the form to be assigned to a group +- https://s.ntnu.no/it1901groups +- deadline: today, 31. august 16:00 +- will announce next week +- the late comers to the course will have a bit more time + + +== Approaching Deadlines + +- Torsdag , 31. august 16:00 +** Fill the group form + +- Torsdag 7. september / 18:00 +** 1st individual deliverable + + +== Help tools + +- Piazza for the course is up and running +- Helpdesk is up and running +- Relevant links and info in Blackboard + + +[background-color = "#124990"] +[color = "#fff6d5"] +== Individual exercise + + +== Læringsmål for øvingen + +* grunnleggende git-ferdigheter +* oppsett av java-prosjekt med maven +* sammenheng mellom navn, struktur og innhold +* oppfriskning om javafx og fxml +* generell feilfinning + +== Hensikt + +Alle skal kunne bidra til prosjektet!!! + +== Grunnleggende git-ferdigheter + +* opprett kodelager på gitlab +* klone mal-kodelager (`git clone`) +* knytte kodelager til annet fjernlager (`git remote`) +* overføre til fjernlager (`git push`) +* lage nye versjoner (`git add` og `git commit`) + +== Java-prosjektoppsett m/maven + +* kildekodemapper og pakkehierarki +** **src/main/java** og **src/main/resources** +** **src/test/java** (og **src/test/resources**) +* pakkehierarki og mappestruktur +** pakkenavn(segmenter) tilsvarer mappestruktur +** både kode og ressurser hører til pakker +** `getClass().getResource(...)` + +== Navn, struktur og innhold + +* klasser og filer, pakker og mapper +* konfigurasjon i pom.xml +** klassenavn (og modulnavn) +** kommandolinje-argumenter +* **module-info.java** +** modulnavn i deklarasjon og `requires` +** pakkenavn i `exports` og `opens` + +== Navn, struktur og innhold + +* **pom.xml** +** konfigurasjon av maven-tillegg +** inkl. kjøring av tester og app +** klassenavn (og modulnavn) +** kommandolinje-argumenter + +== Oppfriskning om javafx og fxml + +[.smaller-80] +* rollefordeling mellom domene- og kontroller-klasse(r) +* kobling mellom fxml og kontroller-klasse +** **fx:id** og **onXyz**-attributter i fxml-fil +** felt og metoder i kontroller-klasse +* programflyt i kontroller +** initiell visning av tilstand +** reaksjon på hendelser +** oppdatering av visning + +== Generell feilfinning + +[.smaller-80] +* tolke symptomer +** hvorfor reagerer ikke appen? +** hvordan finne ledetråder i "stacktracen"? +** hvorfor kalles ikke metoden? +* løse problemet +** utvikle hypoteser om årsaker +** validere (eller falsifiere) hypoteser +** prøve ut løsninger + +== Main steps + +- set up the repo in gitlab +** create a project under students-2023 +** use the javafx-template as a starting point +- change the template +** project name +** packages +- implement the missing logic +** check by running the tests + + +[background-color = "#124990"] +[color = "#fff6d5"] +== Demo time + + +[background-color = "#124990"] +[color = "#fff6d5"] +== Build tools + +== Build tools (1) + +[%step] +- Automate the process of building executable programs from source files +- Packaging binaries required for deployment / distribution +- Run automated tests + +== Build tools (2) + +[%step] +- Build automation is a necessity to enable CI/CD +- Remove the need to do redundant tasks +- Improve quality of the software + ** the software builds are prepared in a consistent and predictable manner + ** possible to have data to analyze issues and improve + +== Make (1) + +[%step] +- Designed by Stuart Feldman +- Released in 1976 +- Uses makefiles to describe the actions required to produce the build +- Manages dependencies + +[.smaller-40] +https://en.wikipedia.org/wiki/Make_(software) + +== Make (2) + +[%step] +- Has been rewriten a number of times +- Standard modern implementation is GNU Make +- Used in Linux and Mac OS + +== Java world build tools + +- Ant with Ivy +- Maven +- Gradle + +== Apache ANT + +[%step] +- modern build system +- released in 2000 +- build files use XML + ** tends to get unmanageable even for small projects +- Apache Ivy for managing dependencies (added later) + ** download over network + +[.smaller-40] +http://ant.apache.org + +== Apache Maven (1) + +[%step] +- released in 2004 +- improves on ANT +- build files use also XML but the structure is radically different +- dependency management with automatic downloading over the network is available from release + +[.smaller-40] +http://maven.apache.org + +== Apache Maven (2) + +[%step] +- hides complexity in build files through plugins +- customizing is hard +- dependency management has issues with conflicting versions of same library + + +[background-color = "#124990"] +[color = "#fff6d5"] +== Gradle + + +== Gradle (1) + +[%step] +- released in 2012 +- build scripts are written in a domain specific language based on Groovy + ** Groovy ( http://www.groovy-lang.org/ ) +- the build script is named `build.gradle` +- build steps are called "tasks" + +[.smaller-40] +https://gradle.org + + +== Gradle (2) + +[%step] +- easy to create own tasks +- uses plugins to hide complexity +- applying plugins allows access to additional tasks + + +== Gradle (3) + +[.center-paragraph] +image::../images/lecture03/gradle-tree.png[width=700] + +[.smaller-40] +https://guides.gradle.org/creating-new-gradle-builds/ + +[background-color = "#124990"] +[color = "#fff6d5"] +== More on Maven + +== Maven (3) + +* manages builds, dependencies, versions +* configuration file is `pom.xml` +* has good IDE support +* central repository(ies) for dependencies + +== Maven - pom.xml + +* modelVersion (4.0.0) config file format version +* groupId - ID of group owning the project +* artifactId - name of the final output +* version - version of the created artifact + +== Maven - pom.xml (cont.) + +* dependencies - list of artifacts we depend upon +* packaging - e.g. .jar (Java archive) +* description + +https://maven.apache.org/pom.html#Quick_Overview + +== Maven dependencies + +* list of dependencies +* each dependecy has specified +** groupId +** artifactId +** version (optional, good to have) +** scope (default is `compile`) + + + + + + + +[background-color = "#124990"] +[color = "#fff6d5"] +== Summary + + +== Next week + +[.smaller-80] +* set up groups +* set up repositories +* announce 1 group exercise +* start working with the group exercise and group contract + +include::{includedir}footer.adoc[] \ No newline at end of file -- GitLab