Packaging the code

The source code provided with this chapter contains skeleton Apex classes shown in the UML diagrams used earlier in this chapter. In the upcoming chapters, we will flesh out the methods and logic within them. For now, deploy them into your packaging org and add them into your package. Note that once you add Apex classes, any Apex classes they subsequently go on to reference will be automatically pulled into the package. 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

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

Upload a new version of the package and install it into your test org. You should see a confirmation install summary page that looks something like the following:

Packaging the code
..................Content has been hidden....................

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