Defining the service classes

Next, we define the service classes Main, Lookup, and Add. These classes contain the following supporting logic:

  • Main: Capturing URL parameters and building an AJAX target URL for the initial view
  • Lookup: Performing purchases lookups
  • Add: Saving a new purchase

First, we will examine the Base class, which all three service classes extend.

Get MongoDB 4 Quick Start Guide 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.