Appearance
Lesson 7 Practice — Notification Polymorphism
Create:
text
ZCL_NOTIFICATION_BASE_###
ZCL_EMAIL_NOTIFICATION_###
ZCL_SMS_NOTIFICATION_###
ZCL_ABAP_L07_PRACTICE_###Base method:
text
GET_DESCRIPTIONRedefine 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:
- Why can one table contain both concrete classes?
- Which method implementation runs for an SMS object held in a base reference?
- What does
REDEFINITIONpreserve? - When would
super->methodbe useful?