AOP stands for Aspect-Oriented Programming and it helps decouple cross-cutting concerns from the object that they affect. It’s similar to DI in the sense that DI helps decouple an application’s object from each other.
From Spring Application Context introduction, we know one of the capability that ApplicationContext has, but `BeanFactory1 doesn't have is event publication.
ApplicationContext provides the event handling through the ApplicationEvent class and the ApplicationListener interface.
If a bean that implements the ApplicationListener interface is deployed into the context, every time an ApplicationEvent gets published to the ApplicationContext, that bean is notified. Essentially, this is the standard Observer design pattern.
The org.springframework.beans and org.springframework.context packages are the basis for Spring Framework’s IoC container. The BeanFactory interface provides an advanced configuration mechanism capable of managing any type of object. ApplicationContext is a sub-interface of BeanFactory. It adds:
Easier integration with Spring’s AOP features
Message resource handling (for use in internationalization)
Event publication
Application-layer specific contexts such as the WebApplicationContext for use in web applications.
In short, the BeanFactory provides the configuration framework and basic functionality, and the ApplicationContext adds more enterprise-specific functionality. The ApplicationContext is a complete superset of the BeanFactory and is used exclusively in this chapter in descriptions of Spring’s IoC container.
ApplicationContext is an interface in Spring that provides configuration information to an application. It's the central interface in a Spring application. ApplicationContext is responsible for instantiating, configuring, and assembling beans. It reads configuration metadata to determine what objects to instantiate, configure, and assemble.
ApplicationContext is read-only while the application is running, but it can be reloaded if the implementation supports it. ApplicationContext is different from BeanFactory. BeanFactory creates a bean object when the getBean() method is called. ApplicationContext loads all the beans and creates objects at startup.
Singleton instance per Spring IoC container. This is the default.
prototype
Scopes a single bean definition to any number of object instances. That means, every time, it requires to inject the bean or the getBean method is called. Continue reading
In Spring, we can easily define configuration value in a YAML file, and inject those configuration into a Java class.
Take the following the YAML configuration file as an example.
YAML
server:localhost# by default, spring split the string with commalistValues:a,b,c,d# if we want to split the string with customize character, we can use Spring ELlistValuesWithSpEL:a,b;c,d;e,f# we can inject the whole complexObject into another class, with annotation ConfigurationPropertiescomplexObject:port:90ssl:falselistValues:a,b,c,dlistValuesWithSpEL:a,b;c,d;e,f
RSQL is a query language for parametrized filtering of entries in RESTful APIs. It’s based on FIQL (Feed Item Query Language) – an URI-friendly syntax for expressing filters across the entries in an Atom Feed.
RSQL JPA translates RSQL query into org.springframework.data.jpa.domain.Specification or com.querydsl.core.types.Predicate and support entities association query.