Skip to content

Instantly share code, notes, and snippets.

View mazenmelouk's full-sized avatar
👻
NPE

Mazen Melouk mazenmelouk

👻
NPE
View GitHub Profile
@mazenmelouk
mazenmelouk / walkthrough.md
Last active March 5, 2024 08:42
Adding a repository

Spring Boot + Database integration

Before you start, download and set up the base project and make sure it builds and runs successfully.

1. Add required maven dependencies

Add the following as a maven dependency (under dependencies tag)

i. spring-boot-starter-data-jpa reduces the code required for querying the database.

@mazenmelouk
mazenmelouk / Adapter.java
Last active February 28, 2024 09:09
Simple Design Patterns Examples
import java.util.Map;
class Adapter {
private static final Map<String, MillimeterProductDimensions> PRODUCT_DIMENSIONS_IN_MILLIMETERS_STORE = Map.of(
"product1", new MillimeterProductDimensions(20, 10, 50)
);
static abstract class ProductDimensions {
private final double length;