Spring Boot, Dependency Injection, IOC and MVC

What project are we building?

Basic ecommerce platform from Backend side.

What all steps we need in flipkart?

  1. Auth
  2. Search product functionality
  3. Product details
  4. Cart
  5. Payments
  6. Order tracking
And many more features.

Tools needed:

  1. Postman - A platform through which we can test our APIs.
    1. APIs - UI interact with Backend logic by using request response cycle. So exposing backend logic to UI we need API (application programming interface).
  2. IntelliJ Ultimate

What is framework?

  1. Develop APIs
  2. Interact with Databases
  3. Logging and Monitoring
  4. Cache
  5. Deployment
In this case we start building it from scratch then it will waste our time and hence we need to use framework which is a collection of codes which can help us to implement all these things with minimum time and help us to implement our idea with easy and keep us focus to solve the business usecase rather than wasting time on unnecassry coding which can be achieved by using a framework.

Framework - Easy to use/efficient way of doing common things.
They help in:
  • Security
  • Auth
  • DB interaction
many more.

Java use - spring, drop wizard
Python - Flask, Sonic, FastAPI, Django.
C# - .net
Golang - gin

Backend have two parts:
Concept are same in different languages.
Implementation depends on Language.

Monolithic:
Disadvantage of Monolithic architecture - If all the services are clubbed together then SPOF will take place. Even if anyone service fails then all other services will also fails. In this case you will create a GOD code which is very hard to monitor and maintained. As if we are going to have only one repo then language will also be the same or single.

Microservices:
In this case we have devided our code into small services were different services can work independently by using APIs. As a result we have overcome the Monolithic issues.

Spring a go to framework for creating enterprixe grade java application.
  • Secure
  • scalable
  • proper logging
Spring has two part spring core and spring projects like Spring Data, Spring Auth etc.

Challenges with Spring till 2015:
  1. import module
  2. xml for accessing database
  3. Config
  4. Different version of different module of spring don't work with each other.
To solve all above issues Spring boot come in picture. It manage version of different modules. It has created the list and library of modules and helped developer to download right modules to build there projects without getting into compatibility issues.
Spring boot sets up default value for almost every config params.

Spring Core:

Creating the database information in one class and then pass it to all other classes which need it as dependency injection.

Dependency injection will be implemented by Spring framework itself as it will help to implement Inversion of Control by using Annotation.










Comments

Popular posts from this blog

Version Control System

Introduction to Backend Development