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 ...
Get Apex Design Patterns now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.