Download MetaTrader 5
To add comments, please log in or register
Publish your article to let the traders see it in MetaTrader 5!
Ovo Cz
2988
Ovo Cz 2016.12.01 15:24 

I learned that MQL5 implemented the interface keyword.

Could someone bring me some insight how it could be helpful? I did not find any use of it, it seemed more like a limited abstract class than the interface (as known in Java).

whroeder1
13959
whroeder1 2016.12.01 15:55  
Language Basics / Data Types / Structures, Classes and Interfaces - Reference on algorithmic/automated trading language for MetaTrader 5
An interface allows determining specific functionality, which a class can then implement. In fact, an interface is a class that cannot contain any members, and may not have a constructor and/or a destructor. All methods declared in an interface are purely virtual, even without an explicit definition.
Exactly a limited abstract class, syntactic sugar.  No need for Abstract Classes and Pure Virtual Functions, implicitly pure virtual functions.
Ovo Cz
2988
Ovo Cz 2016.12.01 18:57  
Thanks, so I can forget it.
Amir Yacoby
1137
Amir Yacoby 2016.12.04 12:26  
Ovo Cz:

I learned that MQL5 implemented the interface keyword.

Could someone bring me some insight how it could be helpful? I did not find any use of it, it seemed more like a limited abstract class than the interface (as known in Java).

If metaquotes will add the possibility of a class to inherit a class and at the same time implement an interface it will be useful.

Without it, it's a half way.
Ovo Cz
2988
Ovo Cz 2016.12.05 07:55  
Amir Yacoby:
If metaquotes will add the possibility of a class to inherit a class and at the same time implement an interface it will be useful.

Without it, it's a half way.
Yes, this is the (only) way the interface can be used.
Amir Yacoby
1137
Amir Yacoby 2016.12.05 18:20  
Ovo Cz:
Yes, this is the (only) way the interface can be used.
Just recieved an update from metaquotes saying it will be allowed to do so.
/
To add comments, please log in or register