OOP - Interface

 

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).

 
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.
 
Thanks, so I can forget it.
 
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.
 
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.
 
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.
 
Amir Yacoby:
Just recieved an update from metaquotes saying it will be allowed to do so.

Probably, though I am afraid it won't happen this life.
 

It's actually problematic‌ and easier to achieve taking the regular route.

 
Marco vd Heijden:

It's actually problematic‌ and easier to achieve taking the regular route.


Are you talking about implementation or about coding?‌ As for coding, the only workaround I have been using are wrappers. So instead of adding a single method, I need to define a new class.

 

I created one item and tried to replicate it multiple times which was dramatic so i ended up writing the entire thing in classical terms which worked fine.

The problem was in the (string) identifiers they got mixed up maybe i will find a solution in the future but for now i tend to stay away.‌

 
Marco vd Heijden:

I created one item and tried to replicate it multiple times which was dramatic so i ended up writing the entire thing in classical terms which worked fine.

The problem was in the (string) identifiers they got mixed up maybe i will find a solution in the future but for now i tend to stay away.‌

To be honest, I cannot figure out what you are describing.