上QQ阅读APP看书,第一时间看更新
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.