Category: Spring Core

The Spring Ioc container is at the core of the Spring Framework. BeanFactory and ApplicationContext provide implementations of the IoC container. Both BeanFactory and ApplicationContext are interfaces and there are several implementations that come out of the box with Spring. In this post, I will explain the differences between BeanFactory and ApplicationContext. Major Differences between […]Continue reading

The Spring IoC (Inversion of Control) container manages Spring beans. A “Spring bean” is just a Spring managed instantiation of a Java class. The Spring IoC container is responsible for instantiating, initializing, and wiring beans. The container also manages the life cycle of beans. Spring provides several ways through which you can tap into the […]Continue reading

Enterprise Spring applications typically need to run in multiple environments. For example, development, testing, staging, and production. Each such environment has its own set of settings. For example, you might be using an embedded H2 database for development but an enterprise-grade Oracle or MySQL database for production. So the data source and connection configurations for […]Continue reading

Using inheritance can be a valuable time saver for your Spring Framework configurations. In Spring, a bean definition is the configuration information that we provide for beans. For example, bean definition can include property values and constructor arguments of the bean. Bean definition can also include container-specific information, such as init and destroy method settings, […]Continue reading

In this post, I’ll explain how to work with resources in Spring using ResourceLoader. We’ll begin with a brief introduction about resources. Next, we’ll look at the Resource interface and some of its important methods. Finally, we’ll go through its implementations. Introduction: Working With Resources In Spring via ResourceLoader Frequently, we need to read external resources […]Continue reading

Spring Aware Interfaces allow you to hook into the inner workings of the Spring Framework. Though Spring Aware interfaces, you can access the Spring context, or Spring Bean life cycle events. Your Spring beans might require access to framework objects, such as ApplicationContext, BeanFactory, and ResourceLoader . To gain access, a bean can implement one […]Continue reading

The Java Programming language provided support for Annotations from Java 5.0. Leading Java frameworks were quick to adopt annotations and the Spring Framework started using annotations from the release 2.5. Due to the way they are defined, annotations provide a lot of context in their declaration. Prior to annotations, the behavior of the Spring Framework […]Continue reading

One of the things I love about the Grails environment is that it comes with a handy bootstrap.groovy file. This will run at startup of the Spring container. I frequently use this to setup expected data, or to create test data for integration / functional tests. It can be a very convenient way to seed […]Continue reading

Polyglot Programming Is the practice of programming in multiple programming languages. According to Wikipedia it is – In computing, a polyglot is a computer program or script written in a valid form of multiple programming languages, which performs the same operations or output independent of the programming language used to compile or interpret it. In […]Continue reading