5.4. Dynamic Behavior in the Standings Application

Up to this point, our example application has behaved in a batch mode. When the application is started, it reads all of the data it needs, performs the necessary calculations, and then displays the results.

Now that we've started to support Web access to the application, we have to ask whether this still makes sense. For one thing, we may get many requests for the data from different users. It would be silly to recalculate the standings each time we get a page request, if the data has not changed. So in ServletOne we began caching the results of our calculations. But let's take that a step further. If the application is going to be up and running for a period of time, rather than just long enough ...

Get J2EE™ and JAX™: Developing Web Applications and Web Services 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.