In the previous episode we gave parent and child classes read capability via a single interface. In this episode we apply the Interface Segregation Principle (ISP) from SOLID: we split read, write and listen capabilities into separate interfaces, give each class only the capabilities it needs, and show how a class can implement multiple interfaces separated by commas.
Spring Boot from Scratch episode 10 is available on the Opendart Academy YouTube channel. This series is prepared from recorded lessons of our live Java Spring Boot course; we start from Java fundamentals and progress toward Spring Boot.
▶ Watch the lesson on YouTubeAll episodes in the series
What's in this lesson?
- 00:00 Introduction
- 00:03 Separating capabilities instead of one large interface
- 00:57 IReadable: a separate interface for read capability
- 03:14 Why are interface methods public?
- 04:08 Which class needs which capability?
- 06:00 Adjusting parent and child classes for the new interfaces
- 06:36 Implementing multiple interfaces on a class: implements A, B
- 08:28 Letting Eclipse add the missing method
- 09:09 Closing
Opendart Academy
Learn Spring Boot with an instructor in live lessons
These videos are from the recorded lessons of our Java Spring Boot course. The full course covers Java, Spring Boot, REST API, databases and real projects; you can ask the instructor when you get stuck.
← Previous episode: Using Interfaces in Java: implements, import and Filling Methods · Playlist: Spring Boot from Scratch · Subscribe on YouTube
Instructor: İbrahim Gökyar (Opendart Academy)



