The state pattern
Having implemented so many patterns effectively, the Universal Call Center team is very excited and realizes that they can review its existing code and identify whether it can be remodeled effectively using appropriate design patterns.
One such interesting area identified by the team was to handle various case-related functionalities based on the case's status. For example, if the case has a status, new, then the case cannot be closed. If the case's status is Open, then the agent can create case comments and so on.
The team realized that the existing code for this functionality is not very scalable and is prone to issues. Currently, the code is placed in an if-else block and is highly nonmodular.
This is just a basic example to ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access