Submitted by heartin on Sat, 10/22/2016 - 23:43
Bill of Materials
Spring boot calls its collection of dependencies as BOM or bill of materials.
The Spring Boot starter parent is responsible for most of the default configurations, plugins etc. which aides in the BOM. When adding dependencies, Spring boot tries to add matching dependency versions which will work together well. Your starter dependencies such as spring-boot-starter-web will not have to specify any versions.
Submitted by heartin on Sat, 09/10/2016 - 23:47
A Spring Boot application uses the @SpringBootApplication annotation over the main executable class. The SpringApplication.run method call accepts two parameters — the configuration class annotated with @SpringBootApplication annotation and any application arguments.
We will use a simple bean class based on our previous examples.
Submitted by heartin on Sat, 09/10/2016 - 22:34
Spring Boot can help us create Spring applications much faster than otherwise. Spring Boot is based on "conventions over configuration" and you have to do very little in configuring an application. For example, you can create a web application with an embedded server in few minutes and you can "just run" them like a desktop application.
Spring boot home page @ https://projects.spring.io/spring-boot/ describe itself as follows:
Submitted by heartin on Fri, 09/09/2016 - 06:04
Here I will list out upcoming notes or notes sections (books) on Spring.
Aspect Oriented Programming
Testing with Spring
Transactions with Spring
Spring and Data
Spring Boot Essentials (In progress)
Spring MVC Essentials (In progress)
Submitted by heartin on Fri, 09/09/2016 - 05:56
There are different ways to executing some code during initialization and destruction of a bean. We could do that using InitializingBean interface, but there are better approaches using annotations.
We will see two of such approaches here:
Using initMethod and destroyMethod attributes of the @Bean annotation
Submitted by heartin on Fri, 09/09/2016 - 04:37
Beans in Spring can be either singletons or prototypes. Singleton means that only one instance of the bean will be maintained by the Spring and will be returned every time you call the getBean() method. If you set the scope to prototype, then a new bean will be created every time you call the getBean() method.
The default is singleton. In Java configuration, you can specify that a bean scope is prototype by specifying @Scope("prototype") over the bean definition.
Submitted by heartin on Fri, 09/09/2016 - 01:13
These are additional exercises you can try out once after learning and practicing all the previous exercises in this section. There will be also hints to make things easier.
Provide examples for autowire for type and autowire by constructor.
Rewrite the following programming using annotations and java configuration: http://javajee.com/autowiring-in-spring-through-xml-configuration-example.
Submitted by heartin on Tue, 09/06/2016 - 20:15
Traditionally Spring applications were configured using only xml configurations. Later annotations such as @Component came and complemented the xml configuration. However later XML configurations were completely replaced by Java configurations that use annotations such as @Bean.
In xml configuration, you use xml to configure beans.
We can load an xml configuration file from a standalone application as:
Submitted by heartin on Tue, 07/05/2016 - 21:03
Below JAX-RS annotations aid in mapping a resource class (a POJO) as a web resource:
Submitted by heartin on Tue, 07/05/2016 - 20:28
REST follows resource oriented architecture as opposed to the popular service oriented architecture followed by SOAP web services.
Resource-Oriented Architecture has four important concepts: