- Hands-On Design Patterns with Java
- Dr. Edward Lavieri
- 89字
- 2021-06-24 14:58:03
Use case
To demonstrate the chain of responsibility design pattern, we will use the university email scenario briefly mentioned in the previous section. For our example, we design a system that takes incoming emails and searches for specific keywords to help determine which university team the email should be routed to. Specifically, we will account for the following:
As you can see from the table, we identified handler classes to be implemented in Java. Having individual handlers for each type of email request will improve our application's efficiency.