Skip to content

Prefer instance to static methods

Methods should be instance members by default. Instance methods better reflect the “object-hood” of the class. They can be mocked easier in unit tests.

METHODS publish.

Methods should be static only in exceptional cases, such as static creation methods.

CLASS-METHODS create_instance
  RETURNING
    VALUE(result) TYPE REF TO /clean/blog_post.
From SAP/styleguides under CC BY 3.0 — more details
Last updated on