Introduction to PlantUML: Unleashing the Power of Visual Representation as a Code in Software Development

Introduction

In the fast-paced world of software development, effective communication and clear documentation are paramount. This is where the power of visual representation comes into play, and one tool that has significantly simplified this process is PlantUML. This open-source project has revolutionized the way developers, project managers, and analysts create and share diagrams. It’s not just a tool; it’s a visual language that transforms the way we think about and document software architecture, processes, and workflows. Continue reading “Introduction to PlantUML: Unleashing the Power of Visual Representation as a Code in Software Development”

Deploying a Quarkus or any java based microservice behind an Nginx reverse proxy with ssl using docker

Deploying a Quarkus or any java based microservice behind an Nginx reverse proxy with ssl using docker diakogiannis jee.gr

Reposted in my medium blog here 

It has been a while but as per a friend requested I am going to show you how to deploy a Quarkus microservice behind an Nginx reverse proxy using docker.

What are we going to do…

I am going to install docker and docker-compose on a centos 8 host and I am going to deploy a docker container that will expose Nginx on ports 80 and 443 and a microservice using Quarkus. The same technique can be used with ANY java microservices framework like microprofile, Springboot etc because in the end what you will do is run a simple jar file (java is magic right?).

Let’s start…

I am going to skip the installation details for docker and docker-compose. In case you haven’t heard of docker-compose have look here https://gabrieltanner.org/blog/docker-compose and you’ll love it. It automates your container deployments and it just rocks! Continue reading “Deploying a Quarkus or any java based microservice behind an Nginx reverse proxy with ssl using docker”

Git Essentials Crash Course

Introduction

This is not Java but several newbie developers ask the same question, how to use GIT and how does GIT works so here it goes…

Have you ever work in SVN? Well forget everything you know and lets start over 🙂

What is a GIT repo?

In general there are two mirror repos. Your local repo and the remote repo. Yes TWO REPOS. Everyone in the team has an actual copy of the whole repo so even if your remote server dies you can set it up again and just push (spoiler) your repo to the repote server.
Continue reading “Git Essentials Crash Course”

The Transient Keyword in Java and Its Use

This article is originally posted by me in Java Code Geeks with title

The Transient Keyword in Java and Its Use

I recently came a cross in a study project of one of my friends that are studding the basics of programming in Java some forgotten sensitive information printed in text files and remembered the transient keyword in Java.

The transient keyword in Java plays an important role in terms of security and can be very useful in “accidents” like the one above as it will prevent the transmission of sensitive information like for example passwords to files, JSON messages etc that will require serialization.

To cut the long story short, if you define any variable as transient, it will not be serialized unless you define it as static or final.

Lets see some examples bellow. Continue reading “The Transient Keyword in Java and Its Use”

We are switching to ENGLISH

We decided to switch the blogs main language to english. Why?

Because programmers MUST know English!

To be able to act in a community or group we must able to share our ideas. Whether we like it or now English is the glue that ties all people together, hence we decided to adopt it here.

So sorry guys but we need to change 🙂

Java Quiz no1

Consider the following code

[code language=”java”]

public class JavaApplication4 {

/**
* @param args the command line arguments
*/
public static void main(String[] args) {

String testValue = "1";

try{
  testValue = "2";
return;
}catch(Exception e){

}finally{
testValue = "3";
}

}
}

[/code]

What will be the value of testValue at the end of execution?

Πως επιλέγω το κατάλληλο Implementation για το Collection μου

Java Collections Cheat Sheet

Συχνά στους junior programmers έρχομαι αντιμέτωπος με το πρόβλημα του να χρησιμοποιούν ένα  collection implementation, συνήθως  ArrayList ή HashSet, επειδή απλά αυτό βλέπουν συχνά χωρίς να ξέρουν τις ιδιαιτερότητές του με αποτέλεσμα διάφορα προβλήματα όπως να χάνεται η σειρά ενώ τη χρειάζονται, να χάνονται διπλές εγγραφές κλπ.

Οπότε αποφάσισα να γράψω αυτόν τον οδηγό για την κατάλληλη επιλογή του

Continue reading “Πως επιλέγω το κατάλληλο Implementation για το Collection μου”

Δημιουργία συμπιεσμένου ZIP αρχείου με Java

Αυτό το χρειάστηκα σήμερα το πρωί. Η φιλοσοφία είναι ότι έχουμε να διαχειριστούμε κάποια αρχεία σε ένα ή παραπάνω φακέλους στο δίσκο και πρέπει να δημιουργήσουμε ένα συμπιεσμένο zip αρχείο με τα αρχεία αυτά.

Η λύση είναι αρκετά απλή.

  1. Παίρνουμε τις διαδρομές των αρχείων και τις βάζουμε σε ένα collection (Array πχ)
  2. Ανοίγουμε ένα output stream στο δίσκο που του “δίνουμε zip ιδιότητες”
  3. Διαβάζουμε ένα-ένα τα αρχεία και τα βάζουμε στο  output stream
  4. Κλείνουμε το stream