Appearance
Lesson 9 Practice — Shipping Cost Utility
Create:
text
ZCL_SHIPPING_CALCULATOR_###
ZCL_ABAP_L09_PRACTICE_###Constants
Define rates for at least two shipping tiers.
Static methods
Create:
text
CALCULATE_STANDARD
CALCULATE_EXPRESSBoth import a weight and return decfloat34.
Optional class data:
text
calculations_doneIf used, make it externally read-only and explain why mutable class state should remain minimal.
Runner
Call methods with =>; do not instantiate the calculator.
Use at least one FINAL(...) local input.
Questions
- Why is
=>used instead of->? - Why is a shipping rate a good constant?
- What is shared about
CLASS-DATA? - What is the difference between
CONSTANTSandFINAL(...)? - When would an instance calculator be preferable to static methods?