Packaging the code

The source code provided with this chapter contains skeleton Apex classes shown in the UML diagrams used earlier in the chapter. In the upcoming chapters, we will flesh out the methods and logic in them. The following is a list of the Apex classes added in this chapter and the application architecture layer they apply to:

Apex class

Layer

SeasonController.cls

Visualforce Controller

SeasonControllerTest.cls

Apex test

ContestantController.cls

Visualforce Controller

ContestantControllerTest.cls

Apex test

RaceController.cls

Visualforce Controller

RaceControllerTest.cls

Apex test

SeasonNewsletterScheduler.cls

Apex Scheduler

SeasonNewsletterSchedulerTest.cls

Apex test

RaceService.cls

Race Service

RaceServiceTest.cls

Apex test

SeasonService.cls

Season Service

SeasonServiceTest.cls

Apex test

ContestantService.cls

Contestant Service

ContestantServiceTest.cls

Apex test

 
Note that there is one class, SeasonNewsLetterScheduler, that requires the use of the global access modifier. This ensures that the class cannot be deleted or renamed in future releases. This might feel restrictive, but it is the key to supporting the Apex Scheduler feature in this case. It is important when users upgrade to new versions of your package that the schedules they have defined continue to reference the code in your package.

If you create a new version of the package and install it in your test org, you should see a confirmation installation summary page that looks something like the following:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.141.24.134