The traditional approach

The traditional approach uses polling to check whether the stock price has changed. The following sequence diagram shows the traditional approach of building such a use case:

Once the page is rendered, it sends AJAX requests to the stock price service for the latest price at regular intervals. These calls have to be done irrespective of whether the stock price has changed since the web page does not have any knowledge of the stock price change.

Get Mastering Spring 5.0 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.