Discussing the article: "Connexus Observer (Part 8): Adding a Request Observer"

 

Check out the new article: Connexus Observer (Part 8): Adding a Request Observer.

In this final installment of our Connexus library series, we explored the implementation of the Observer pattern, as well as essential refactorings to file paths and method names. This series covered the entire development of Connexus, designed to simplify HTTP communication in complex applications.

This article is the continuation of a series of articles where we will build a library called Connexus. In the first article, we understood the basic operation of the WebRequest function, understanding each of its parameters and also created an example code that demonstrates the use of this function and its difficulties. In the last article, we created the client layer, a simple and intuitive class responsible for sending requests, receiving a request object (CHttpRequest) and returning a response (CHttpResponse) that contains information about the request, such as status code, duration, body and response header. We also created a decoupling of the class with the WebRequest function, making the library more flexible, creating a new layer called CHttpTransport.

In this eighth article of the series, we will understand and implement an Observer in the library, to facilitate the management of multiple requests by the client. Let's go!

Author: joaopedrodev

 
Kristian Kafarov #:

Hello! I copied all the files from this article + additional files from the previous one to the MQL5 folder. Here is what I got when trying to compile Connexus\Test\TestRequest.mq5:


Flash to the very first error, fix it and everything will work
 

In short, implicit signed/unsigned array type conversion is no longer allowed.

Some changes need to be made to the code.