This video is an exercise about implementing a factory in Spring and having the framework utilize it.
- [Instructor] So now that we've … talked about Factory pattern, … it's time to see it in action. … If you open up the exercise files in your IDE, … you'll see that I've already started the application for you … by creating a Spring Boot starter … and adding a couple of controller class … as well as an interface … and some implementations for our Factory. … Let's take a look at the interface real quick. … You'll see my Pet interface has several methods. … Things that make sense … when dealing with various types of pets … that are really equal across all pets. … And that's really how we want to start … when dealing with the Factory. … So we're going to create a new class called PetFactory. … And this Factory we're going to want Spring to actually manage. … So we're going to do an @Component annotation on it. … Now there's going to be one method on our Factory. … And that method is the Factory method itself. … So it's going to return a Pet … and it's going to be called createPet … and it's going to take a string of animalType. …
AuthorFrank P Moley III
- The patterns of the Spring framework
- Creational patterns in Spring
- The adapter and decorator pattern in action
- Structural patterns in Spring
- The repository pattern in action
- The observer, command, and mediator patterns
Skill Level Advanced
Spring: Framework In Depth (2017)with Frank P Moley III2h 16m Intermediate
What you should know1m 28s
1. Design Patterns and Spring
2. Creational Patterns in Spring
3. Structural Patterns in Spring
4. Operational Patterns in Spring
5. Other Framework Patterns in Spring
Next steps3m 27s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.