Posts

Showing posts from 2021

Microservices

Microservices: -------------- What is Monolithic Application: ------------------------------- * All type of components included in the single project, That is called Monolithic application. Eg.  College Project (Including all below modules in the single project): ->Student ->Faculty ->Examination ->Result ->Address What is Microservice: -------------------- * Micro -> small * Creating multiple small services * So here we will create all the component as a seperate application (micro services).  * So here creating multiple spring boot projects.  Eg: (Below all creating as seperate application): ->Student ->Faculty ->Examination ->Result ->Address Advantages: * Testing -> If you change any one microservice you can test that alone and you can deploy that alone. So nothing else get down * Scalable -> Any specific applicaiton we can scalable. Eg. at the time of result , we can scale up the result micorserive up and others down. * Loosely ...

Monolithic & Heterogenous Application

 * Where one project containing all the modules (huge code base), that is called Monolithic application. Problem: * Due to this, if we want to change any small piece of code, you need to do full round of testing. And we need to down the whole system. * To avoid this they introduced Microservice Architecture (Heterogenous)

Spring - Dependency Injection

 * If you want to inject a one bean into another bean that is called dependency injection.  * Using the spring IOC container we can do easily just adding @Autowired annotation.

Blocking Queue

 * Blocking Queue is helping us to use the producer consumer concept in Java

Fail Safe vs Fail Fast Iterator

* When we are iterating the collections, and at the same time if we are modify the collection, then it will throw uninterepted exception.  This is Called Failed Fast Iterator. * But it will not throw the error for above use case, that is called Fail Safe Iterator. Eg for Fail Safe Iterator, CopyOnWriteArrayList, ConcurrentHashMap - These are synchronized. So it will not throw error

Create Generic Class

 * Generic Class to handle parameterized types.  * Example if class name called Employee. And the ID field may be some cases string and some usecase it should be number. Then at run time we can specify the DataType and we can make use of the same class.  Eg. public class Employee <T> {    private T id;    public void add(T id) {       this.id = id;    }    public T get() {       return id;    }    public static void main(String[] args) {       Employee<Integer> integerEmployee = new Employee<Integer>();       Employee<String> stringEmployee = new Employee<String>();            integerEmployee.add(new Integer(1001));       stringEmployee.add(new String("Hello World"));       System.out.printf("Integer Value :%d\n\n", integerEmployee.get());       Syst...

What are the Object Class Methods Available ?

  * public int hashcode() * protected void finalize() * protected Object clone() * public String toString()