Interfaces
The concept of an interface class is purely a syntactic assist when you are defining an application class which is totally composed of abstract methods and properties. In this case by simply specify the keyword interface you are indicating that all the methods and properties are abstract. The following two definitions are semantically equivalent.
class MyInterface
method MyMethod1() abstract;
method MyMethod2() Returns string abstract;
property string myproperty1 abstract readonly;
property number myproperty2 abstract;
property number myproperty3 abstract;
end-class;
interface MyInterface
method MyMethod1();
method MyMethod2() Returns string;
property string myproperty1 readonly;
property number myproperty2;
property number myproperty3;
end-interface;
When you provide an implementation for an interface you can also use the keyword implements instead of extends. While this is not mandatory, specifying implements describes more accurately what your application class is doing.
If your class implements an interface, you don't need to create an object reference to the superclass since the system does that automatically for you.
In addition if your
constructor takes no parameters and simply exists to create an object
reference to the superclass (that is, there is only one statement
such as %Super
= create mySuper();), then you don't need to define a constructor
method at all.