100% de satisfacción garantizada Inmediatamente disponible después del pago Tanto en línea como en PDF No estas atado a nada 4.2 TrustPilot
logo-home
Resumen

Samenvatting Java Advanced (Theorie)

Puntuación
-
Vendido
1
Páginas
16
Subido en
13-07-2021
Escrito en
2019/2020

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

Institución
Grado










Ups! No podemos cargar tu documento ahora. Inténtalo de nuevo o contacta con soporte.

Escuela, estudio y materia

Institución
Estudio
Grado

Información del documento

Subido en
13 de julio de 2021
Número de páginas
16
Escrito en
2019/2020
Tipo
Resumen

Temas

Vista previa del contenido

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
$10.32
Accede al documento completo:

100% de satisfacción garantizada
Inmediatamente disponible después del pago
Tanto en línea como en PDF
No estas atado a nada

Conoce al vendedor

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
GraduateITF Thomas More Hogeschool
Seguir Necesitas iniciar sesión para seguir a otros usuarios o asignaturas
Vendido
20
Miembro desde
4 año
Número de seguidores
9
Documentos
16
Última venta
1 mes hace

3.0

1 reseñas

5
0
4
0
3
1
2
0
1
0

Recientemente visto por ti

Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes