The iterator pattern

Developers of Universal Call Center are given the task of displaying a customer banner on the service cloud. This banner should display the account name and ticker symbol of a customer. This functionality needs to be reusable so the team decides to use a newly launched Salesforce lightning platform to create a banner component. An expected requirement is to display one account at a time. Team discussed an approach to retrieve all the required accounts and display them in a sequence. However, as this would result in lots of records being stored in the browser memory, this solution is not memory-efficient. So, the team identifies that they need a solution wherein they can retrieve one account at a time.

The iterator pattern ...

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.