Multiple inheritance

December 30th, 2008 | Tags: , , , ,

The PPL object-oriented syntax has evolved once more for version 2.0. It now includes multiple inheritance, which allow you to inherit a class from multiple other classes.

#class MyClass1
Private(a$);
#endclass

#class MyClass2
Private(b$);
#endclass

#class MyClass3 inherit MyClass1, MyClass2
a$ = 10;
b$ = 20;

public proc test
ShowMessage(a$, “,”, b$);
end;
#endclass

proc main
o$ = new MyClass3;
o.test;
end;

This allow for very powerful applications. You can inherit as many classes as you want, there are no limits. The inherited classes can also inherit from other classes, which can lead to very complex but highly maintainable code.

No comments yet.
You must be logged in to post a comment.
TOP