Home Demos Forum Research Guide
Viewing topic in forum 'general'
back to topic list

Method Overriding and Method Overloading
Does Dana support method overriding and method overloading just as OOP languages like Java does?
by enesi on 2015-06-17 17:58:07 (1 reply)

Hi,

Dana supports a form of overriding, but does not currently support overloading.

Overriding occurs for example when we have the following interface definitions:


interface IntfA{
   void functionA();
   void functionQ();
}
 



interface IntfB{
   void functionB();
}
 


And then we have a component that implements IntfB as follows:


component provides IntfB requires IntfA{
   void IntfB:functionB() {
   }

   void IntfB:functionA() {
   }
}
 


In the above example, the component provides a form of overriden implementation of funtionA from IntfA. It does not implement functionQ from IntfA, so calls to functionQ are still directed to their implementation in the component that provides IntfA.

Does that answer your question?

Let me know if you'd like any further detail / clarification on this.

- Barry
by barry on 2015-06-18 08:39:48
© Francis Research Ltd. 2017