We have been accustomed for many years to developing with an imperative and deterministic computing model. We can see that imperative programming is a programming paradigm that describes computing through actions, statements, or commands that change the state of a program.
If we look at the previous example all the commands will be executed as actions and in the written order.
When we externalize these kind of commands to Input/Output (I/O) operations, such as a database access, these executions happen synchronously, that is, the program will wait for the query result.
If you are tired of handling explicit nullpointers exception in Java 7 or lower, I’ve developed a Optional class for this porpouse.
Sometimes, some companies has a lot policies for upgrading for Java 8. So, I’ve decided to create my own Optional class to use in Java 7.
See the full implementation:
import java.util.NoSuchElementException;
public class Optional<T> {
private static final Optional<?> EMPTY = new Optional(Null.INSTANCE);
private T value;
protected Optional(T value){
this.value = value;
}
public static <T> Optional<T> of(T value){
return new Optional<T>(value);
}
@SuppressWarnings("unchecked")
public static <T> Optional<T> empty(){
return (Optional<T>) EMPTY;
}
public static <T> Optional<T> ofNullable(T value){
if(value == null){
return empty();
}else{
return of(value);
}
}
public boolean isPresent(){
return !(this.value …
In order to distinguish this two types of architectures and the question “Is it a difference at all?”. To go deeper in this matter that raised thousands of debates, I will briefly define both architectures (SOA and Microservices) and further they are going to be compared.
Service Oriented Architecture is a software architecture which components communicate with each other using communications protocol over the network. The type of communication involved in this architecture could involve simple data transportation, service mediation, service orchestrations. …
Open API Specification (formerly called the Swagger Specification) is a contract description format of APIs for the REST architectural standard. An OpenAPI file allows you to describe your API, including:
Specifications can be written in YAML or JSON message format.
To understand what happened to Swagger, we will first address the institution that is taking care of this new version of the specification, being it the Open API Initiative (OAI). …
Every day in software developer life is a challenge. The standards we knew yesterday are on the run, in pursuit of a larger goal of delivering software with fewer errors, faster and cheaper. Consequently, these usage views and paradigms are happening with the use of Enterprise Service Bus (ESB).
If we look at this new world trend of transforming the company into a digital platform, by APIs. The implementation of this architecture can be realized by several paradigms, being within the business world the Service Oriented Architecture (SOA) one of the most Used.
Microservices Architecture (MSA) is an implementation of a SOA specialization. The focus is the construction of flexible systems deployed in independent systems that communicate via the network between them to reach their goal, and are agnostic to any technology. The MSA takes advantage of the introduction of new movements like DevOps to build systems with Continuous Integration (CD) and Continuous Delivery (CD). …
About