Learn how to use the IoC paradigm in Spring to develop your service layer while focusing on good OOP development. This video demonstrates how to formally build a single service layer and then shows any other services needed.
- [Instructor] Okay, now would be a great time…to probably take a look at your Exercise Files…and refresh them with the latest data.…And the reason that I say that…is I've added a couple classes in the entity package…that basically would have been very repetitive…of what we did on the Room,…the Guest entity, and the Reservation entity specifically.…I also added associated repositories…for both of those entities in the repository package.…
So, you can pull those from the Exercise File.…That would be great,…because we're actually going to need them now…as we start building our service abstraction layer.…I'm gonna go ahead and close all of those down.…So, we'll go ahead and create a new package.…Again, I'm gonna start with com.frankmoley,…your mileage may vary.…And we're going to build a landon.business.service package.…And in the business.service,…we will create a new Java class.…
And that Java class is called ReservationService.…Now, I'm gonna go ahead and annotate…this class with the @Service annotation.…I like to use the specific stereotype…
- Creating a project with Spring Initializr
- Examining the Spring Boot skeleton project with Spring Data JPA
- Creating an embedded database for Spring Boot development and testing
- Building a service abstraction
- Using the IoC paradigm in Spring to develop a service layer
- Building a controller
- Testing a controller MockMvc
- Exposing a service layer through REST
Skill Level Intermediate
Q: This course was updated on 09/06/2018. What changed?
A: The following topics were updated: creating a project with Spring Initializr, examining the Spring Boot skeleton project, developing a service object with Spring, and testing a controller MockMvc.