Skip to content
Vikyath Shirva

Spring, Spring Boot?

- Vikyath Shirva

To get a broader understanding of how any web application or applications work, the way they work is because of a collaborative work done by each individual component that is designed for a particular purpose. A similar working, imagine the human body; the way the human body works is through all organs and muscle group’s collaborative function. Now similarly when applications run, the individual components somehow need to be created and introduced to each other so that the meaningful collaboration happens much elegantly.

What does is do different?

What spring framework offers here is that at its core, is a container called Application Context; what this does is it manages all the application components. These components or also called as beans; will be wired together. All of this happens inside the application context this in all makes the whole application.

This so called wiring between the components or so called beans inside the Application Context is done based on a pattern called Dependancy Injection (DI), which i will explain in detail in another post, but for now; what this means is that suppose that there is an application that has many components, and by many components I mean there are many objects that you need, so for example imagine you need a user, in the scope of OOP you create objects of a particular class, now say you need a user you create a user out of user class, that makes sense; what if you need another user you would create another instance from the user class, perfect; now image you need to user a service, lets say this is called user service that does some common operation for everyone, well to use this what do you do? exactly, create an instance of this service; now hold on here I just discussed about creating objects, from the example we just created objects from user and service, there is a difference in these two keep in mind, in java there is Data objects and Service objects loosely speaking, now from all the instances we created we know we can created new objects for users whenever we needed, true. But what do you do when you need an instance of a service? you just need one instance of this so that multiple users can use this common operation; now this brings a thought as to how would you do this? how do you share a common service between different instances of other classes, Now that in rough words is what Dependancy Injection (DI) does, ill get into details about this in another post; but for now imagine that when we create numerous objects and we need to share some objects between some other DI does the job for us.

Potions Class

On top of its container, it also provides related libraries such as a web framework, monitoring , integration with other systems and many other features.

Historically, the way you would tell the Application Context to wire the components was through XML, now we see a Java-based configuration more common. Autowiring and Component Scanning play an important role in automatically configuring the spiring application, what Component Scanning does is it automatically discovers components from the application’s classpath and creates them as components or beans in the Spring Application Context. Now with the introduction of spring boot, autoconfiguration has gone well beyond component scanning and autowiring. Spring boot is an extention of spring framework that offfers more enhancements. One of the most amazing feature is autoconfiguration, where spring boot can make some good guesses of what components need to be configured and wired together, based on entries in classpath, env variables etc.

Spring boot enhances Spring developement so much that its hard to imagine developing Spring application without it.

© 2022 by Vikyath Shirva. All rights reserved.