software development (54)

Spring Boot on Kubernetes

Enable Kubernetes in Docker Desktop We will use Docker Desktop to provide us a Test Kubernetes Environment. Open Docker Desktop Settings, go to Tab "Kubernetes". Select "Enable Kubernetes", then "Apply & Restart". Now you should be able to see docker-desktop listed, if you run kubectl…

Continue reading...

Building Spring Boot Docker Images

Pre-Requirements Developer Environment ready with Docker, JDK, IDE A Java Spring Boot Project with a h2 in-memory DB Docker Hub account Create Docker File Create a Dockerfile with the following content: FROM openjdk:11-jre-slim ENV JAVA_OPTS " -Xms512m -Xmx512m -Djava.security.egd=file:///dev/./urandom" WORKDIR application COPY target/myapp-0.0.1-SNAPSHOT.jar ./ ENTRYPOINT…

Continue reading...

Data Validation Overview

What is Validation? Validation is a process of making assertions against data to ensure data integrity Is a value required? How long is a phone number? Is it a good date? What is the maximum length of a string? Some refer to data validation as…

Continue reading...

Data Transfer Objects

Data Transfer Objects DTOs - Data Transfer Objects DTOs are simple Java POJOs DTOs are data structures, generally should NOT have behavior DTOs are objects used to transfer data between producers and consumers Controller models are typically DTOs Why Not Entities? Database Entities are also…

Continue reading...

Spring Exception Handling

HTTP Status Codes 100 Series - Informational Responses • 200 Series - Successful Responses 300 Series - Redirection Responses 400 Series - Client Error Responses 500 Series - Server Error Responses Use of HTTP Status Codes 200 Series are used when the request completes as…

Continue reading...