This video goes over some real-world needs for building a functional service tier in your application and stubbing your services through Spring.
- [Frank] Now we're going to talk about…one of the probably more opinionated sections for me…within this entire training…and that is the building of a service abstraction.…Now when we're dealing with separation of concerns…one must always balance cleaner code…versus too many class files.…Indeed in this example application…an argument could definitely be made…that the service abstraction yields less clean code.…
However, I don't want to skip over the fact…that often we need to expose our data…in more than one way…and a service abstraction really allows us to do that.…Because let's be honest, in today's world…of mobile computing and systems to systems computing…and internet of things…there's always more than one way…that you need to expose your data…to various services, applications, and whatnot.…Another benefit of the service abstraction…especially in the RDBMS world…is it allows you to build complex transaction boundaries.…
If we simply rely on the repositories themselves…to be transactional boundaries…which indeed they could be…
- 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.