Overhead for the PLO - page 5

 
fxsaber:

You have your own wrapper, the other one has his own. The question was whether it's possible to create a more convenient wrapper than MQL4.

I don't think there's much to choose from...

Personally I need the wrapper only for cross-platform - to separate the Expert Advisor logic from the specifics of this or that platform

 
Andrei:

Of course, you have to pay for the beauty of OOP with resources and much time spent on debugging. OOP only makes sense as a convenient text wrapper or when used minimally during runtime initialization... Actually, OOP was just a marketing thing from Microsoft to increase the costs of programmers' working hours and to stimulate the purchase of more advanced equipment. And they are not fools themselves and write all the software in C and assembler.

What a visionary you are...

 
govich:

You're a dreamer, aren't you?

Do you have anything meaningful to say on the topic of discussion?

 

Once again I came across...

In MQL, it is impossible to "not crookedly" separate the implementation of methods from the prototype and there is no way to provide the user (customer, tester, friend/friend) with a separate *.mqh file and separate *.ex4 file (similar to *.h and .obj/lib/dll in C++)

 
Maxim Kuznetsov:

Once again I came across...

In MQL, it's impossible to "unconditionally" separate the implementation of methods from the prototype and there is no way to provide the user (customer, tester, friend/friend) with a separate *.mqh file and separate *.ex4 file (similar to *.h and .obj/lib/dll in C++)

Could you be more specific about the task? It seems to be fairly straightforward to provide a header with an imported factory that returns clean interfaces, and the entire implementation is crammed inside ex4.

 
Stanislav Korotky:

Can you be more specific about the task? It seems it is possible to provide header with imported factory, which returns clean interfaces, and all the implementation is stored inside ex4.

The task is to give the user the class library with the least amount of effort, which consists of: mqh where the classes are described and ex4 where their implementation is stored.

The only option to date drags a lot of text with crutches to get around this bottleneck.

If you know a short and handy way to remove CFoo implementation in ex4, please share the recipe.

class CFoo {
public:
   CFoo();                         //default
  CFoo(const CFoo orig); // copy
   ~CFoo();
   bool Set(string key,CFoo & link); 
   CFoo *Get(string key);
   bool Clear(string key);

};

 
Maxim Kuznetsov:

the task is to give the user a class library consisting of: mqh in which the classes are described and ex4 in which they are implemented.

The only option so far pulls a lot of text with crutches to get around this bottleneck.

If you know a short and convenient way to remove CFoo implementation in ex4, please share the recipe.

class CFoo {
public:
   CFoo();                         //default
  CFoo(const CFoo orig); // copy
   ~CFoo();
   bool Set(string key,CFoo & link); 
   CFoo *Get(string key);
   bool Clear(string key);

};

Well I already wrote a way - why it's not suitable? You make a factory method, or function, which returns the abstract class (interface) described in the header file. The whole implementation is hidden. The real example can be found, for example, in my blog about library of optimization of experts on the fly (in English).

Фабричный метод (шаблон проектирования) — Википедия
Фабричный метод (шаблон проектирования) — Википедия
  • ru.wikipedia.org
Шаблон проектирования Тип: Назначение: Структура: Плюсы: Минусы: Описан в Design Patterns Фабричный метод (англ.  также известен как Виртуальный конструктор (англ.  )) — порождающий шаблон проектирования, предоставляющий подклассам интерфейс для создания экземпляров некоторого класса. В момент создания наследники могут определить, какой...
 
Stanislav Korotky:

Well, I've already written a method - what's wrong with that? You make a factory method, or function, which returns an abstract class (interface) described in the header file. The whole implementation is hidden. The real example can be found, for example, in my blog about library of optimization of experts on the fly (in English).

Try to throw the source code. And everybody knows the links to the wiki here
 
Maxim Kuznetsov:
Try throwing in the source code. And everyone knows the links to the wiki

Isn't the link to the source wiki ok? ;-)

 
Stanislav Korotky:

Isn't the link to the source wiki ok? ;-)

but it won't :-)

I'm telling - try to do it, it's a fierce lot-of-code. Instantifiable class "CFoo: public InterfaceCFoo" must contain field InterfaceCFoo *privateContext (do 1:1 link), create and delete it via factory, delegate all methods and translate CFoo* references this<->privateContext here and there. This is "sunsetting the sun by hand", i.e. replacing inheritance with delegation, and on the spot.