We will initiate three environment applications on Heroku: Staging, Pre-production and Production.
Staging environment will be attached to a staging branch, Pre-production to the master branch and production environment will be updated each time we add a protected tag to the master branch.
Source code could be found at https://gitlab.com/elie29/quarkus-gitlab-ci-Heroku
We will not cover GraalVM nor docker through this article in order to focus on the pipeline and its different stages. However…
How to store properly JWT token in a browser
On several applications, I noticed that JWT token is stored in local storage, session storage or through unsecured cookie. These weak techniques are vulnerable to XSS attack and token stealing (cf. session hijacking attack for more information)
Source code could be found at: https://github.com/elie29/jwt-token-storage
The application is split into two parts: frontend and backend folders:
Through my previous article, we explored how to extract conditionals into functions using simple and convenient use cases. However, more complicated situations won’t be addressed by simple extractions.
Along this exercice, we will replace a switch statement with a well known concept — Polymorphism.
First, as an example, we’ll focus on evaluating simple Algebraic Expressions such as “1 + (6 + 5) * 8” or in a more general manner by respecting associativity and Operator Precedence:
a OP b OP c
(a OP b) OP c
a OP (b OP c)
Most of the time, having several conditionals inside a function and many levels of nested indentation make the code source so tedious to maintain, difficult to read and rapidly unclear — the pyramid of doom.
In the previous episode, we explored how to exit a loop without violating the Object Calisthenics rule: “Only One Level Of Indentation Per Method”! Through this article, we discuss two examples of nested IFs and try to explain, step by step, how to get rid of all these conditional structures.
Let’s dive into the first example and see how to change the code structure in…
Let’s start by an example to explain our problem. Suppose we have the following static method — static just for this example purpose — :
Lead Web Application Architect. Passionate about refactoring, clean code, and building scalable solutions with simplicity.