From the course: Java Design Patterns: Behavioral Part 1
Unlock the full course today
Join today to access over 22,500 courses taught by industry experts or purchase this course individually.
Challenge: The Chain of Responsibility pattern - Java Tutorial
From the course: Java Design Patterns: Behavioral Part 1
Challenge: The Chain of Responsibility pattern
(upbeat music) - [Instructor] Let's have a look at our first challenge. This is a challenge to complete an app that handles authentication requests using the chain of responsibility pattern. So the app should be able to handle three different types of requests, basic authentication, client certificate authentication, and digest authentication. So there are three handler classes, one for each type of authentication. So those're a basic authentication handler, a client certificate authentication handler, and a digest authentication handler. And these all extend an abstract class called authentication handler. This abstract class and all of the three handler classes, that extend currently have an empty method called handle request. You'll notice that none of the classes have a defined constructor. So this means the default empty constructor will be used. But in order to create a chain of responsibility, you will need…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.