Akka Immutable Messages

Posted on Leave a commentPosted in Akka, Java

By default Akka does not make your variables immutables, so if you are passing around message/objects with mutable variables there is still a case where you can experience a deadlock. That is why it is highly recommended to use immutable messages when integrating with Akka Actors. What are immutable messages? Basically these are variables that […]

Static vs Instance variables

Posted on Leave a commentPosted in Java

Static vs Instance variables When you declare a variable static, there is only one copy of that variable per class. Consider the following example (bad encapsulation code do not copy): when we use static, there is only one copy per class, so no matter how many Humans objects we have, there is only one PLANET, […]

Set vs List vs Map

Posted on Leave a commentPosted in Architect, Java

Basic Question in Java is usually what is the difference between Set/List/Map. Set – is used usually used when you want to keep a collection of items that have no duplicates. Plain and simple. So think set when you want a unique collection of items. Variations TreeSet (interface: SortedSet) – sorts the value in the […]

Docker Introduction

Posted on Leave a commentPosted in Architect, Java

What is Docker?  “Docker is the world’s leading software container platform. Developers use Docker to eliminate “works on my machine” problems when collaborating on code with co-workers. Operators use Docker to run and manage apps side-by-side in isolated containers to get better compute density. Enterprises use Docker to build agile software delivery pipelines to ship […]

Completable Future – Futures Library

Posted on Leave a commentPosted in Architect, Java

Writing Async calls with Java 8 Say hello to Java 8 asynchronous library. This enables us to prepare calls that do not immediately return a response. CompletableFuture works like a promise, saying that this process will eventually end, but do not wait on it. Let’s dive in to the details, below is the most basic […]

Reactive Microservices

Posted on Leave a commentPosted in Architect, Java

Reactive microservices “its not the big fish which eats the small fish, its the fast fish that eats the slow fish” In traditional programming sense, we are all familiar with monolithic applications, meaning one big chunk of war or ear that contains all your business logic and connects to one data storage, usually a relational […]

java.util.function library

Posted on Leave a commentPosted in Architect, Java

As in previous topic, we can use functional interfaces to use in lambda expression see topic on: Java 8 interfaces However Java 8 goes on more to provide us mechanism to easier create lambda expressions. See java.util.function library. No need to create an functional interface and just overwrite existing ones in this library. This library […]

Java 8 Interfaces

Posted on Leave a commentPosted in Architect, Java

There are several changes for interfaces, including the addition of static and default methods. Interfaces in java 8 is more and more similar to abstract method.  Consider the example below: Key notes: static static methods inside interfaces are only accessible inside the interface. No way to access from outside the interface, see initializeTestData() method above. default default […]

Java 8 Lambda Function

Posted on Leave a commentPosted in Java

Lambda functions – enables you to treat functionality as method arguments. The forEach() method for handling a collection of data. In this case, we have a list of Person, instead of doing a for loop we are using lambda syntax: For more complex methods you can wrap it in brackets, acting as anonymous classes. Lambda expressions can […]