Posts

SOLID Principle (Quick Read)

Image
 The famous design principle comprises 5 design strategies that a developer should follow for a successful application development Single Responsibility Principle Open/ Close Principle Liskov Substitution Principle Interface Segregation Principle Dependency Inversion Single Responsibility Principle(SRP) No code unit(function/class/package) should have more than one responsibility.   Bad Ex:   Class Bird  {     String result;;    public fly(Bird bird)    {     if(bird==piegeon)       result="flys 20 meter hight";    else if(bird==hen)       result="flys 5 meter";    else        result="not measured yet";    } } This class should design such a way that it should work well for all the types of birds current design is hectic to maintain for the following reasons  difficult to test. difficult in parallel programming  understanding the code is difficult solution: Break the code into multiple packages or classes How to identify SRP is violated(Litmus test to SRP)

Microservice -Cloud Configurations -Spring

Image
 Let's explore the Microservice deployments ,registration using Service Registry and controlling the communication using APIGateways in next blog. Will create a microservice Library using H2 databass fro the persistance. The entire codebase will be shared in the git will share at the end of the blog. Let's create the Books microservices like below Controller  Services Repository  Entity   application.yaml server : port : 9000 Postman test output Create the Books microservices the same way. Refer to the code from the end. Mail goal is to access using the gateway service Big Step Going to add the microservices to the Service Registry to do that create one more microservices with the below dependency < dependencies > < dependency > < groupId >org.springframework.cloud</ groupId > < artifactId >spring-cloud-starter-netflix-eureka-server</ artifactId > </ dependency > < dependency > < groupId >org.spr

JAVA 8 Predefined Functions

Image
 Java 8 has considerable up-gradation when compare to other releases, I am going to discuss some key concepts that are very much required for the understanding of functional programming way of implementation. I have written one Demo problem which covers all the concepts, better refer to  this code  while reading. Better to understand what is lamdas, default methods, and static methods, this article will be a quick reference. 👍 4 Key Predefined Functions Interfaces 1.) Predicate 2.)Function 3.)Consumer 4.)Supplier 1.)Predicate I nterface Predicate<T> { boolean test(T  t);// functional interface  default Predicate<T> add(); default Predicate<T> or();  default Predicate<T> negate()  static <T> Predicate<T> isEqual(Object targetRef) ====>single static method } This predicate is mainly used for the conditions check, which contains a single abstract method, 3 default methods, and single static methods. Single Abstract Method test(T k); This method will

Linux Basics

Image
More than 90% of cloud servers and many of the webservers are running on the Linux platform so it is handy if we are aware of the Linux basic commands 1.) PWD : Present working Directory 2) CD: Change directory where CD ~ moves to home directory and cd .. just parent directory  3.) ls: List files folders and executable files in the current directory 4.) apt: Advanced Packaging tool (mainly used to install / update new software packaging) Time to try the combination of CD and ls What is the output of  ls cd .. ? or ls  ..? Now try ls /var/log cd -- will points previously worked directory  what about cd ../.. ? 😉 (yes will move to double strap back ) linux commands con be tuned based on our requirements with flags (- with alphabets eg: -a or -- with full name eg:--all) To get the list of flage type man (manual)  command with wich linux command like man ls or man pwd Lets discuss about the file permissions and access we cam see lot of -rw-r--r and x d will decode one by one 😎 - : in

Minikube & Kubectl -Basic Operations

Image
Minikube & Kubectl will help the developer to create the cluster environment in the local machine and can test the functionality to gain more confidence in the deployment pipeline. Minikube is a one-node cluster environment that contains the master and worker process, which creates a virtual box in the local environment and node runs on top of the virtual box. Install minkube using the official URL: https://minikube.sigs.k8s.io/docs/start/  follow instructions based on the operating system. Once done open the command prompt and execute: minikube start. Kubectl is used to communicate with API server, Master process contains the API server and is the entry point for the Kubernetes. Will check basic commands to check the status of minikubes  kubectl get node: will give the node details with the status minikube status: will give details about the minikube components * The main advantage of Kubernetes is the replicaSet, Kubernetes will take care of taking the replication of the pods, an