This repository contains sample projects created while exploring new technologies
- rest-demo is a gradle project. Import it to your favorite IDE
- Run Spring Boot project. This project uses H2 Database.
- Go to http://localhost:8080/h2/ and run initiate_db.SQL file to have product data.
- Make a call to http://localhost:8080/product/1 to get product details response.
- graphql-demo is a gradle project. Import it to your favorite IDE
- Run Spring Boot project. This project uses H2 Database.
- Go to http://localhost:8080/h2/ and run initiate_db.SQL file to have product data.
- The graphql-demo has graphiQL added. So we can play GraphQL queries with GUI. Make a call to http://localhost:8080/graphiql
- Send below query to see product JSON response.
{ product(id:"1") { id, title, shortDesc, listPrice, reviews { reviewTitle, reviewText } } }
Follow below steps to setup legacy-user-service and refactored-user-service project based on https://youtu.be/ebdAdkIuDEc
The blog on the same is here https://smarttechie.co/refactoring-complex-conditional-logic-with-rules-design-pattern-d9a348c18f14
Title: Simplify Complex Validation Logic with the Rules Design Pattern | Spring Boot
Description: Struggling with complex validation logic in your application? Not able to manage and write unit tests? The Rules Design Pattern will save you. In this video, I will walk you through how to simplify and structure your validation logic using this powerful design pattern. We can achieve S.O.L.I.D principles when we apply Rules Design Pattern.
🔥 What You’ll Learn: ✅ What is the Rules Design Pattern? ✅ Why use it for validation? ✅ Look at the legacy code which has complex validation logic ✅ How to refactor the legacy code with Rules Design Pattern