100% Zufriedenheitsgarantie Sofort verfügbar nach Zahlung Sowohl online als auch als PDF Du bist an nichts gebunden 4.2 TrustPilot
logo-home
Zusammenfassung

Samenvatting Java Advanced (Theorie)

Bewertung
-
Verkauft
1
seiten
16
Hochgeladen auf
13-07-2021
geschrieben in
2019/2020

Samenvatting van Java Advanced dat in het 2e jaar Applicatieontwikkeling en AI wordt gegeven.

Hochschule
Kurs










Ups! Dein Dokument kann gerade nicht geladen werden. Versuch es erneut oder kontaktiere den Support.

Schule, Studium & Fach

Hochschule
Studium
Kurs

Dokument Information

Hochgeladen auf
13. juli 2021
Anzahl der Seiten
16
geschrieben in
2019/2020
Typ
Zusammenfassung

Themen

Inhaltsvorschau

Les 1: MVC met Spring Boot en Thymeleaf
MVC staat voor Model-View-Controller = een patroon dat ervoor zorgt dat programma’s
in 3 lagen worden opgebouwd met het oog op de leesbaarheid, onderhoudbaarheid en
uitbreidbaarheid van programma’s.

De 3 lagen binnen het MVC-patroon:

• In de ‘back-end’ bevindt zich de ‘Model’-laag: deze laag is opgevuld met
zelfgemaakte klassen die gebruikt zullen worden om gegevens in te plaatsen
(attributen) en functionaliteiten uit te voeren (methoden)
• De ‘Controller’-laag = de ‘tussenlaag’ of middle-tier: hierin zitten de klassen die de
communicatie tussen de view en de model regelt
• De ‘front-end’ of de ‘View’-laag regelt de interface voor de gebruiker. In een
webapplicatie bestaat deze laag uit webpagina’s waarin html-, css-, afbeeldingen
enz… gezet worden.

Thymeleaf is een server-side Java template engine

• Stelt een aantal extra attributen (th:) ter beschikking om te gebruiken in HTML-
pagina’s
• Samen met data uit het model gaan deze tags dan dynamisch inhoud aanvullen of
weglaten uit de HTML-pagina
• Worden door de compiler geïnterpreteerd en omgezet naar échte HTML-pagina’s




Spring Framework

• one of the most widely used JEE-frameworks for building applications for the java
platform
• It aims to simplify the JEE development and helps developers be more productive
at work
• focuses on several areas of an application and provides a wide range of features
• One of the major features is the dependency injection. It helps make things
simpler by allowing us to develop loosely coupled applications

Spring Boot

• While the spring framework focuses on providing flexibility to you, spring
boot aims to shorten the code length and provide you with the easiest way to
develop a web application

• It helps create a stand-alone application with less or almost zero-configuration

• Autoconfiguration is a special feature in spring boot. It automatically
configures a class based on that requirements

• Dependency resolution

• Minimum configuration

• Embedded server for testing



JDK 2020 1

, • Bean auto scan

• Heath metrics

Spring Framework & Spring Boot werken met @annotaties

Controller in Spring Boot:

• er is geen extra code nodig om van een klasse een controller te maken en om de
inhoud van de HTTP-request’s te controleren. Dit wordt gedaan door de annotaties.
Elk http-request MOET nu wel via de Controller passeren.
• Is een klasse @Controller
o Bij het opstarten van de applicatie wordt automatisch een object van de
klasse MainController gemaakt waarmee het request kan opgevangen worden
o Request opvangen met @RequestMapping
o Om een gegeven door te sturen van een webpagina heb je Model klasse
nodig
o Model.addAttribute() voegt een gegeven toe aan het model object
o Met @{..} kan je naar een URL verwijzen
o Je kan interessante methoden gebruiken om datums, getallen, Strings enz…
op te maken door “Expression Utility Objects” van Thymeleaf te gebruiken. Dit
doe je met het prefix #

Les 2: REST

REST = Representational State Transfer

Something that allows one piece of software to talk to another piece of software over the
HTTP protocol.

REST requires that a client makes a request to the server in order to retrieve or modify data
on the server. A request generally consists of:

• HTTP verb (get, put, post, delete)
• Header which allows the client to pass along information about the request
• Path to a resource

Rest: SEPARATION OF CLIENT AND SERVER

• In the REST architectural style, the implementation of the client and the
implementation of the server can be done independently without each knowing about
the other. This means that the code on the client side can be changed at any time
without affecting the operation of the server, and the code on the server side can be
changed without affecting the operation of the client.

• As long as each side knows what format of messages to send to the other, they can
be kept modular and separate. Separating the user interface concerns from the data
storage concerns, we improve the flexibility of the interface across platforms and
improve scalability by simplifying the server components. Additionally, the separation
allows each component the ability to evolve independently.




JDK 2020 2

, • By using a REST interface, different clients hit the same REST endpoints, perform the
same actions, and receive the same responses.

Rest: stateless

• Systems that follow the REST paradigm are stateless, meaning that the server does
not need to know anything about what state the client is in and vice versa. In this
way, both the server and the client can understand any message received, even
without seeing previous messages. This constraint of statelessness is enforced
through the use of resources, rather than commands. Resources are the nouns of the
Web - they describe any object, document, or thing that you may need to store or
send to other services.

• These constraints help RESTful applications achieve reliability, quick performance,
and scalability, as components that can be managed, updated, and reused without
affecting the system as a whole, even during operation of the system.

@RestController is an annotation for creating Restful controllers. It is autodetected through
classpath scanning. It converts the response to JSON or XML. It is typically used in
combination with annotated handler methods based on the @RequestMapping annotation
(@GetMapping, @PostMapping, @PutMapping, @DeleteMapping).

JSON format?

• JavaScript Object Notation

• a lightweight format for storing and transporting data

• is often used when data is sent from a server to a web page

• Standard for NoSQL databases like MongoDB

• "self-describing" and easy to understand

A POST request to /opleidingen adds the new opleiding-object that is
delivered with the request, and then returns the saved opleiding-object for
the user to view

@RequestBody

Says that the body of the incoming POST request is an Opleiding object




JDK 2020 3

Lerne den Verkäufer kennen

Seller avatar
Bewertungen des Ansehens basieren auf der Anzahl der Dokumente, die ein Verkäufer gegen eine Gebühr verkauft hat, und den Bewertungen, die er für diese Dokumente erhalten hat. Es gibt drei Stufen: Bronze, Silber und Gold. Je besser das Ansehen eines Verkäufers ist, desto mehr kannst du dich auf die Qualität der Arbeiten verlassen.
GraduateITF Thomas More Hogeschool
Folgen Sie müssen sich einloggen, um Studenten oder Kursen zu folgen.
Verkauft
20
Mitglied seit
4 Jahren
Anzahl der Follower
9
Dokumente
16
Zuletzt verkauft
1 Jahren vor

3,0

1 rezensionen

5
0
4
0
3
1
2
0
1
0

Kürzlich von dir angesehen.

Warum sich Studierende für Stuvia entscheiden

on Mitstudent*innen erstellt, durch Bewertungen verifiziert

Geschrieben von Student*innen, die bestanden haben und bewertet von anderen, die diese Studiendokumente verwendet haben.

Nicht zufrieden? Wähle ein anderes Dokument

Kein Problem! Du kannst direkt ein anderes Dokument wählen, das besser zu dem passt, was du suchst.

Bezahle wie du möchtest, fange sofort an zu lernen

Kein Abonnement, keine Verpflichtungen. Bezahle wie gewohnt per Kreditkarte oder Sofort und lade dein PDF-Dokument sofort herunter.

Student with book image

“Gekauft, heruntergeladen und bestanden. So einfach kann es sein.”

Alisha Student

Häufig gestellte Fragen