100% tevredenheidsgarantie Direct beschikbaar na je betaling Lees online óf als PDF Geen vaste maandelijkse kosten 4.2 TrustPilot
logo-home
Samenvatting

Samenvatting Java Advanced (Theorie)

Beoordeling
-
Verkocht
1
Pagina's
16
Geüpload op
13-07-2021
Geschreven in
2019/2020

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

Instelling
Vak










Oeps! We kunnen je document nu niet laden. Probeer het nog eens of neem contact op met support.

Geschreven voor

Instelling
Studie
Vak

Documentinformatie

Geüpload op
13 juli 2021
Aantal pagina's
16
Geschreven in
2019/2020
Type
Samenvatting

Onderwerpen

Voorbeeld van de inhoud

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

Maak kennis met de verkoper

Seller avatar
De reputatie van een verkoper is gebaseerd op het aantal documenten dat iemand tegen betaling verkocht heeft en de beoordelingen die voor die items ontvangen zijn. Er zijn drie niveau’s te onderscheiden: brons, zilver en goud. Hoe beter de reputatie, hoe meer de kwaliteit van zijn of haar werk te vertrouwen is.
GraduateITF Thomas More Hogeschool
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
20
Lid sinds
4 jaar
Aantal volgers
9
Documenten
16
Laatst verkocht
1 maand geleden

3,0

1 beoordelingen

5
0
4
0
3
1
2
0
1
0

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Veelgestelde vragen