Static Components: (Attributes / Methods)
These Static components exist globally for a class and are referred to using static
component selector =>. In the code, if you see => or use => then you should
correlate that it is Static Component (it can be an attribute i.e. variables/constants or it
might be methods).
The static component only exists once per class and are valid for all instances of the
class. They are declared with the CLASS- keywords
Instance Components: (Attributes / Methods)
These Instance components exist separately in each instance (object) of the class and
are referred using instance component selector using ->. So know you know the
difference between => and -> in ABAP Objects.
We will dedicate a whole article on Static and Instant concept in future posts.
1. Attributes: Any data, constants, types declared within a class form the
attribute of the class.
2. Methods: Block of code providing some functionality offered by the class can
be compared to function modules or subroutines/performs. They can access
all of the attributes of a class.
Methods are defined in the definition part of class and implemented in the
implementation part using the processing block.
Declaration:
METHODS <Method name>.
Implementation:
METHOD <method name>
………
END METHOD.
Methods are called using the CALL METHOD statement.
3. EVENTS: A mechanism set within the class which can help a class to trigger
methods of another class.
4. Interfaces: Interfaces are independent structures that you can implement in
a class to extend the scope of the class. We will discuss Interfaces in
subsequent parts. For now, check this interesting post on Interface – Is
INTERFACE the Leaky Bucket of OOPs Design?