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 […]

Declaration and Access Control

Posted on Leave a commentPosted in Java

Identifiers identifiers begin with letter, underscore or currency After the first letters, identifiers can contain digits can be any length must be camelCase methods Example of all valid identifier String b, _hello, $holder, number5, reallyreallyreallyreallylongName; Declaration Rules source code file can only have one public class file name must match class name one package statement, […]

Comparable vs Comparator

Posted on Leave a commentPosted in Architect, Java

Purpose: Comparable/Comparator are used to allow comparison of two or more objects. For example you have Person object and you want to add a natural ordering of each person by age. In other words to keep the order of each person from youngest to oldest or vice versa in a ordered collection like TreeSet (There are other ordered […]

Balanced Braces Algorithm

Posted on Leave a commentPosted in Java

Typical problem scenario: For every opening brace (i.e., (, {, or [), there is a matching closing brace (i.e., ), }, or ]) of the same type (i.e., ( matches ), { matches }, and [ matches ]). An opening brace must appear before (to the left of) its matching closing brace. For example, ]{}[ […]

Java Home

Posted on Leave a commentPosted in Architect, Java

 Basics Refresher Java Basic Concepts (JDK/JRE/JVM,  stack heap) Balanced Braces Algorithm Comparable vs Comparator Set vs List vs Map Static vs Instance variables How to turn on Profiler Declaration And Access Control Java 8 Lambda  Functional Interfaces Java.util.function library Completable Future Streams Hibernate Hibernate – A collection with cascade=”all-delete-orphan” was no longer referenced by the […]