Posts

Showing posts from December, 2019

Mutable Vs Immutable

Image
Have you ever heard this statement? Strings are Immutable. Yes if you have ever learned Java. 😇 But do you know why?. Ok, Today we are going to find out. When you take an object, it can be changed after it has assigned a value. Then it is mutable Once an object is assigned a value, if it can't be changed Then we call it an Immutable Object But if it is how a string is immutable. I remember I've changed the value of a string String name = "Ravinda"; name = "Roshan" See you don't get any trouble doing that. and if you print the value you get the value as Roshan here. So what the hell are you saying???? 😡😡 Ok, Calm Down, I'll Explain by taking this example. public class Student { private String nameOne ; private void testThis () { nameOne = "Ravinda" ; System . out . println ( nameOne . hashCode ()); nameOne = "Roshan" ; System . out . println ( nameOne . hashCode ());...

Microservices - 01

Image
Introduction to Microservices Microservices are distributed, loosely coupled software services that carry out a small number of well-defined tasks carry out a small number of well-defined tasks. Before Going for the microservices, let's look into the monolithic architecture which is the traditional approach. Before Microservices architecture came into action, Monolithic architecture was used. (Nowadays also many Software Companies still use this and they tend to move for microservice architecture) In a Monolithic architecture, Software is delivered as a single artifact. All the UI (user interface), business and database access logic are packaged together into a single application artifact and deployed to an application server. This is how a company which has its products in a monolithic architecture. In a Monolithic architecture, When a change of a module is done, in order to deploy, have to reinstall all the other modules also. Sin...

Spring boot - 02

Image
Let's Create a Simple Rest Web Service 01.Preparation  Hi all, Today we are going to start hands-on on our first spring boot rest web service. Requirements ... Java 1.8 or above. Gradle for dependency management Spring CLI v2.2.1.RELEASE Mongo DB Spring too suite (STS)  You can use Maven instead of Gradle if you want. If you still don't know what Maven/Gradle is, check this post[link]. Instead of using STS you can use IntelliJ IDEA if you want. But in here all the steps I have mentioned are for STS.  Here is the spring installation guide to get Spring boot CLI.  Spring boot CLI installation So if you are all set with the above requirements.  STEP -01 Open STS and File -> new Project Select Spring Starter Project. Click next.  You'll get the window "New Spring Starter Project". Give a Proper Name for the Project.  Since I'm going to create a service that we can save/get movie details. So I name it ...