Skip to content

Lesson 7 Practice — Notification Polymorphism ​

Create:

text
ZCL_NOTIFICATION_BASE_###
ZCL_EMAIL_NOTIFICATION_###
ZCL_SMS_NOTIFICATION_###
ZCL_ABAP_L07_PRACTICE_###

Base method:

text
GET_DESCRIPTION

Redefine it in both subclasses.

Create a standard internal table of references to the base class.

Append several Email and SMS objects.

Loop once and print GET_DESCRIPTION for every object.

Questions:

  1. Why can one table contain both concrete classes?
  2. Which method implementation runs for an SMS object held in a base reference?
  3. What does REDEFINITION preserve?
  4. When would super->method be useful?